fix(server): recover Codex sessions after process exits - #32
Merged
Merged
Conversation
The Codex adapter forwarded a runtime's session.exited event but left the dead session in its map, so hasSession and listSessions kept reporting the thread as live. Startup reconciliation trusts listSessions and the session reaper skips sessions holding an activeTurnId, so a thread whose Codex process died mid-turn stayed running and showed Working forever. (cherry picked from commit 95c96c1) (cherry picked from commit 636b575)
(cherry picked from commit 67b5747)
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
Port the reviewed Codex process-exit recovery fix from upstream PR pingdotgg#12922 onto this fork's
v0.1.69release line. It handles an App Server killed bySIGKILL, drops the dead adapter session, and lets the next turn resume without restarting T3 Code.The port includes the original upstream authors' commits and the follow-up lifecycle fixes and regression tests. Related upstream issue: pingdotgg#12904.
Validation on this fork branch
bun run fmt: passed; clean worktree.bun run lint: passed with existing warnings.bun run typecheck: passed across 15 workspaces.git diff --check origin/fork-main...HEAD: passed.Fork CI runs on this PR. Merging into
fork-mainwill trigger the fork's own release workflow, which should publishv0.1.70with installable Linux, macOS, and Windows assets. No running server is updated by this PR.