A provider start defect or cancellation could pin session activity. Counter-based activity also allowed duplicate or delayed terminals to release a successor. A thread-local recovery failure could stop healthy threads from recovering.
Track activity by attempt, learn native turn identity from its root snapshot, and remove the same entry on failed starts or matching terminals. Isolate per-thread recovery failures while preserving cancellation and global failure behavior. Upstream #15323 already supplies shutdown-preparation isolation; the duplicate implementation was removed. Preserve #15604's settled-thread restart behavior.
Add conformance checks at the raw adapter boundary for native snapshot-before-terminal ordering, repeated attempts, stale terminals and ordinary steering. Production null-admission and identity-learning coverage is in #15307. No missing-snapshot fallback or adapter behavior change is added. A healthy stream missing its snapshot still has no idle-release deadline; explicit close or stream failure clears activity, while reattaching to the same entry does not.
Verification:
- Dependency-aligned native restart coverage passed 7 cases; representative actual-runtime replays passed 32 cases across eight harnesses.
- After the first upstream merge, five lifecycle/recovery suites passed 110 tests. After merging captured main
4ee6bfd50e, 63 affected recovery/restart/startup integration tests passed.
- An independent lifecycle check confirms a late failed-attempt snapshot cannot release its successor.
- The earlier full 125-case replay run passed 124 tests and failed one Windows
EBUSY workspace cleanup, reproduced on pristine published source. No ordering assertion failed.
- Scoped server typecheck and changed-file lint/format passed, with three existing ACP test lint warnings. No live-client verification or performance measurement was performed.
The harnesses cover Codex, Claude, Cursor, Grok, ACP registry, OpenCode, OpenCode2 and Pi. Grok shares ACP; Antigravity has no dedicated replay fixture. These tests establish exercised interleavings rather than every future provider protocol path.
Draft for maintainer scope review. No prior maintainer approval is claimed.
Implemented with GPT-6.1 Sol through Codex. Audited with Ling 3.1 Flash Free and Space Bunny through OpenCode, plus Codex integration reviews.
Replaced by https://github.com/pingdotgg/t3code/pull/15789, https://github.com/pingdotgg/t3code/pull/15786 under the requested eight-PR split. The existing implementation was reused on clean independent branches against main; the original branch and commits are retained for provenance.