Skip to content

fix(server): preserve provider activity through failed starts and recovery - #15309

Closed
Adamulek123 wants to merge 8 commits into
pingdotgg:mainfrom
Adamulek123:fix/v2-session-lifecycle
Closed

Adamulek123 wants to merge 8 commits into
pingdotgg:mainfrom
Adamulek123:fix/v2-session-lifecycle

Conversation

@Adamulek123

@Adamulek123 Adamulek123 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 3, 2026
@Adamulek123

Copy link
Copy Markdown
Contributor Author

Replaced by #15789, #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.

@Adamulek123 Adamulek123 closed this Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant