Repository navigation
Conversation
Replaces the opaque `sessionId` string + global `sessionId && !worktreePath`
guard at phase-executor.ts:660 with a `ResumeHandle { driver, token,
originCwd }` and a driver-owned `canResume(handle, targetCwd)` method.
ClaudeCodeDriver accepts only byte-equal cwd matches (matches the SDK's
cwd-namespaced storage at ~/.claude/projects/<encoded-cwd>/); on mismatch
it transparently falls back to a fresh session rather than triggering the
SDK's recoverable error_during_execution. AiderDriver declines all resume.
Unblocks same-worktree resume across phases (the prior heuristic disabled
all worktree resume). State files gain a `resumeHandle` field; the legacy
`sessionId` is retained as a one-release @deprecated mirror so in-flight
.sequant/state.json records load cleanly (legacy entries without
originCwd are intentionally inert under the new fail-safe).
AC-5 (CodexDriver same-cwd rule) and AC-7 (Codex AGENTS.md parity) are
gated on #497 landing CodexDriver; placeholder `.skip` tests in
resume-semantics.test.ts light up when that work lands.
Entire-Checkpoint: 879293b67de6
9 tasks
Add the missing direct unit test for the new updateResumeHandle method: writes the driver-tagged handle, mirrors the token into the deprecated sessionId field, bumps lastActivity, and throws on an unknown issue. Closes the one closeable gap flagged in QA for PR #680.
admarble
added a commit
that referenced
this pull request
Sep 9, 2026
Add the missing direct unit test for the new updateResumeHandle method: writes the driver-tagged handle, mirrors the token into the deprecated sessionId field, bumps lastActivity, and throws on an unknown issue. Closes the one closeable gap flagged in QA for PR #680.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sessionId+ globalsessionId && !worktreePathguard atphase-executor.ts:660withResumeHandle { driver, token, originCwd }and driver-ownedcanResume(handle, targetCwd).ClaudeCodeDriver: accepts byte-equal cwd match only; on mismatch transparently starts a fresh session (avoids the SDK's recoverableerror_during_execution).AiderDriverdeclines all resume.Pre-PR AC Verification
ResumeHandle { driver, token, originCwd }onAgentExecutionConfig+AgentPhaseResult;sessionIdkept as@deprecatedmirrorsrc/lib/workflow/drivers/agent-driver.ts:9-77ClaudeCodeDriverpopulatesoriginCwdfromconfig.cwd; returns it on resultsrc/lib/workflow/drivers/claude-code.ts:153-160, 230-237canResume(handle, targetCwd); remove!worktreePathguardsrc/lib/workflow/drivers/agent-driver.ts:97-113;src/lib/workflow/phase-executor.ts:655-669ClaudeCodeDriver: resume only whenoriginCwd === cwd; transparent fallback on mismatchsrc/lib/workflow/drivers/claude-code.ts:42-45, 72-89CodexDriversame rule, enforced in driver.skipplaceholders in fixture testsrc/lib/workflow/phase-executor.ts:655-669; regression test inphase-executor.test.ts:678-705it.skip; preserved/advisory/skipped annotationsrc/lib/workflow/drivers/resume-semantics.test.ts(10 passed, 2 skipped)phase-executor.ts:653commentTest plan
npm run build— cleannpm run lint— cleannpx vitest run src/lib/workflow/— 171 passed, 2 skipped (Codex deferred)phase-executor.ts:655-669replaces the prior heuristic with driver.canResume() — same-worktree resume now threads through.skipon the two CodexDriver fixture casesNotes
IssueState.sessionIdkept as@deprecatedmirror ofresumeHandle.tokenfor one release so in-flight.sequant/state.jsonrecords load cleanly. Legacy entries withoutoriginCwdare intentionally inert under the new fail-safe (driver-ownedcanResume()declines withoutoriginCwdproof).prompt-wait.test.tsandrelay-hook.integration.test.tsconfirmed unrelated to this PR (reproduce on the base branch).Closes #674
🤖 Generated with Claude Code