Fix rescue thread persistence across Claude session resume - #567
Open
Asher123452 wants to merge 3 commits into
Open
Fix rescue thread persistence across Claude session resume#567Asher123452 wants to merge 3 commits into
Asher123452 wants to merge 3 commits into
Conversation
SessionEnd previously deleted completed task records along with active jobs, so a resumed Claude conversation could not resolve its prior Codex thread. Retain terminal job history while still terminating and removing queued/running work.
Fall back to terminating the tracked root process when taskkill reports partial tree failure. Make the no-npm and session-transfer fixtures use Windows-correct executable and home-directory environment names so the full suite is portable.
Author
|
Local verification is complete: The fork workflow is currently |
matcra587
added a commit
to matcra587/codex-plugin-cc
that referenced
this pull request
Jul 30, 2026
SessionEnd removed every job carrying the ending session's id, including completed ones. Claude reuses a conversation's session id when it is reopened, so `/codex:rescue --resume` and the resume candidate lookup then reported no previous task even though the Codex thread was still live, and the stored result had already been deleted with the record. Only tear down work that is still in flight. Queued and running jobs are killed and reaped as before; completed, failed and cancelled records survive so a reopened session can resume them. Retained history stays bounded by the existing MAX_JOBS cap in pruneJobs. The existing cleanup test asserted the old behaviour, so it now pins the corrected contract: the ending session's finished job and its artifacts are kept, and only the in-flight job's log and record are reaped. A new end-to-end test covers task -> SessionEnd -> resume candidate. Both fail without this change. Reported upstream as openai/codex-plugin-cc#567, which is unmerged and Node-based; only the persistence half of it applies here.
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
Why
Claude conversations preserve their session ID when reopened, but SessionEnd deleted every job for that ID. As a result,
/codex:rescue --resumeand the automatic resume candidate lookup reported that no previous Codex task existed even though the Codex thread itself still existed.The full Windows run also exposed partial taskkill failures that made cancellation report failure after successfully interrupting the Codex turn, plus several test fixtures that assumed POSIX executable and HOME lookup behavior.
Verification
npm test: 93/93 pass on Windowsgit diff --checkpass