# Worktree handoff continuation verification

Target: [#15203](https://github.com/pingdotgg/t3code/pull/15203). Verified implementation: [0842d56c9e](https://github.com/jakeleventhal/t3code/commit/0842d56c9ed1c8577c86b99e46596126a854691b).

Linux, Node 24.21, real installed Codex app-server, model gpt-6.1-sol. The full production T3 backend ran with isolated state and a disposable Git repository. The parent called T3 delegate_task; the child called t3_worktree_handoff with a continuation prompt. No provider events, terminal statuses, or business projections were injected for this proof.

## Before and after

- Current main: 174 focused cases pass. The original PR: 185 pass, but the reduced integrated shared-session test exposes its missing detach signal (176 pass, 1 assertion failure).
- Rebuilt change: 177 focused cases pass, including exclusive/shared handoff before the first provider turn. Four existing provider-error, Stop, startup, and shutdown queue controls pass. Parent rerun: both integrated handoff cases pass.
- Removing atomic continuation persistence makes the integrated assertion find only the active run instead of active + queued. Removing the detach reason makes the old run fail instead of interrupt. These are assertion failures, not import/type errors.

## Actual provider result

Parent and child used the same shared Codex provider session. The child old run became interrupted and its running handoff tool became interrupted. Its automatically queued continuation completed, wrote handoff-cwd.txt containing the exact destination working directory, and produced a ready checkpoint containing that file. The parent stayed alive, consumed the completed child result, and completed with HANDOFF_PARENT_DONE. Exactly one child-result context transfer reached the parent.

Persisted handoff transaction:

| Sequence | Event |
| --- | --- |
| 47 | thread.metadata-updated |
| 48 | provider-session.detached |
| 49 | run.created |
| 50 | run-attempt.created |
| 51 | node.updated |
| 52 | checkpoint-scope.created |
| 53 | message.updated |

All seven events share one command ID and accepted receipt. The same command owns a succeeded provider-session.detach outbox effect with reason workspace_changed. The continuation checkpoint scope names the destination directory.

Receipt replay through authenticated orchestration RPC returned the original accepted sequence (53). Child runs stayed 2 -> 2; messages stayed 5 -> 5; child-result transfers stayed 1. The replay did not launch a second continuation.

## Checks and limits

All 177 focused tests, four baseline controls, scoped server/provider-core/contracts typechecks, scoped lint, formatting and diff checks pass. This is backend behavior; no client rendering changed, so screenshots are not evidence for the fix.

Live verification covers Codex on headless Linux. Exclusive-session lifecycle is covered by deterministic integration tests; live Claude, Cursor, Grok, OpenCode, Antigravity, macOS, Windows, iOS, Android and Electron desktop were not verified. Deterministic tests do not claim native-provider coverage. Both the provider home and backend state were isolated, and the owned backend process was stopped after proof.

Implementation: GPT-6.1 Sol; tests: GPT-6 Astra; parent verification: GPT-6.1 Sol, Codex harness inside T3 Code.
