Skip to content

fix(replay): preserve cwd scope for opened sessions#1401

Merged
thymikee merged 1 commit into
callstack:mainfrom
Bortlesboat:agent/1394-replay-session-scope
Jul 25, 2026
Merged

fix(replay): preserve cwd scope for opened sessions#1401
thymikee merged 1 commit into
callstack:mainfrom
Bortlesboat:agent/1394-replay-session-scope

Conversation

@Bortlesboat

Copy link
Copy Markdown
Contributor

Summary

  • preserve the cwd-derived session scope when replay's internal open dispatch uses the effective scoped session key
  • use the carried scope for provisional and final session state so session list from the same cwd finds the opened session
  • add a request-router regression covering replay → open → session list

Closes #1394

Validation

  • pnpm exec vitest run --project unit-core src/daemon/__tests__/request-router-replay-scope.test.ts
  • pnpm typecheck
  • pnpm lint
  • pnpm format:check
  • pnpm check:layering
  • pnpm check:fallow --base origin/main
  • pnpm build

Changed 4 focused daemon/test files. No docs or skills changes were needed.

@thymikee

Copy link
Copy Markdown
Member

Code review is clean: replay now carries the caller’s resolved CWD scope into its nested open, so the stored session scope agrees with the later session list filter. The new full request-router regression is meaningful and would fail before this change.

Before merge, please attach the missing exact-head validation evidence: a live replay containing open followed by session list from the same CWD (the issue reproduced on both iOS and Android), plus the required CI results. No GitHub checks are currently attached to this branch.

@thymikee

Copy link
Copy Markdown
Member

Validated current exact head 202191bfa3db293fd19b39a11dedd1c14e2b110a end to end.

  • PR is mergeable with CLEAN merge state; required GitHub checks are green (Bundle Size skipped).
  • Freshness: installed the lockfile, ran pnpm build, then pnpm clean:daemon.
  • Focused production-router regression: pnpm exec vitest run --project unit-core src/daemon/__tests__/request-router-replay-scope.test.ts — 3/3 passed, including replay → internal open → session list.
  • Live public CLI validation on booted iOS simulator iPhone 16 (C5D49876-B0DE-4839-A2A7-2F6FE3036CA4) using isolated state dir /private/tmp/pr1401-replay-validation/state and purpose-specific cwd: replay of close-less open "com.apple.Preferences" --relaunch succeeded with sessionActive: true and session cwd:e4448b4593e7eb7c:default; session list from the same cwd/state scope returned that exact active session; explicit close succeeded; final inventory was empty.
  • Worktree remained clean; no code changes made.

Residual risk: no external Claude export/cross-review was authorized or performed. Ready for human review.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jul 25, 2026
@thymikee
thymikee merged commit 14be01b into callstack:main Jul 25, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session list omits cwd-scoped sessions opened via replay's internal open dispatch

2 participants