feat(codex): resume by session id instead of --last for parallel-safe…#24
Open
airmonitor wants to merge 1 commit into
Open
feat(codex): resume by session id instead of --last for parallel-safe…#24airmonitor wants to merge 1 commit into
airmonitor wants to merge 1 commit into
Conversation
… sessions `resume --last` resolves to the newest recorded session scoped to the current cwd. When two Codex sessions run in the same cwd (e.g. several rounds against one repo), both resume the same target and the call hangs. Switch the skill to capture each session's id and resume by it: - initial exec runs with `--json` (session id emitted as the `thread_id` of the `thread.started` event on stdout) plus `-o <file>` (clean final message written to a file, so JSONL on stdout does not lose the answer) - resume with `codex exec resume "$SID" "PROMPT"` instead of `--last` - temp files namespaced per-session `$TAG` so concurrent runs don't clobber This is collision-free, fully parallel-safe, and preserves session context across rounds (verified: a resumed-by-id session recalls earlier turns). Updates Quick Reference, Following Up, the "When Codex is Wrong" resume example, and Error Handling. Existing stdin (`</dev/null`) and Execution-timeouts guidance is preserved unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
… sessions
resume --lastresolves to the newest recorded session scoped to the current cwd. When two Codex sessions run in the same cwd (e.g. several rounds against one repo), both resume the same target and the call hangs.Switch the skill to capture each session's id and resume by it:
--json(session id emitted as thethread_idof thethread.startedevent on stdout) plus-o <file>(clean final message written to a file, so JSONL on stdout does not lose the answer)codex exec resume "$SID" "PROMPT"instead of--last$TAGso concurrent runs don't clobberThis is collision-free, fully parallel-safe, and preserves session context across rounds (verified: a resumed-by-id session recalls earlier turns). Updates Quick Reference, Following Up, the "When Codex is Wrong" resume example, and Error Handling. Existing stdin (
</dev/null) and Execution-timeouts guidance is preserved unchanged.