Conversation resuming for codex#9700
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and posted feedback on this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds Codex conversation resume support by fetching saved transcript envelopes, rehydrating Codex JSONL sessions, invoking codex resume, and reusing existing external conversation IDs. It also factors shared transcript fetch and JSONL helpers across harnesses.
Concerns
- The Claude harness no longer compiles:
ClaudeHarnessRunner::newnow destructures a two-tuple, but the non-resume match arm still returns a three-tuple. - Security pass: no additional security findings were found in the changed lines.
Verdict
Found: 1 critical, 0 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
9a49e85 to
83ddb57
Compare
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and posted feedback on this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds Codex conversation resumption by fetching stored Codex transcript envelopes, rehydrating them into the Codex sessions directory, launching codex resume <session_id> with the follow-up prompt, and reusing the existing Warp conversation ID for subsequent saves.
Concerns
- No blocking correctness, security, error-handling, or performance concerns were found in the changed diff lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| New `CodexResumeInfo` struct: `{ conversation_id, session_id, envelope }`. Add `session_start_timestamp: Option<DateTime<Utc>>` to `CodexTranscriptEnvelope` and `CodexSessionMetadata`, parsed from the `SessionMeta` line's `timestamp` field. Used to reconstruct the YYYY/MM/DD directory path when writing back to disk. | ||
|
|
||
| ### 5. `write_envelope` (codex_transcript.rs) | ||
| New function that writes the envelope's JSONL entries back to `<sessions_root>/YYYY/MM/DD/rollout-<ts>-<uuid>.jsonl`. Timestamp comes from `session_start_timestamp`; falls back to `Utc::now()` if absent (codex's lookup is by UUID so the path doesn't need to be exact). |
There was a problem hiding this comment.
(codex's lookup is by UUID so the path doesn't need to be exact)
weird
There was a problem hiding this comment.
Indeed... I did test this with putting sessions in places like /2040/05/01/...-<session_id>.jsonl and codex resumes them with the session ID totally fine
| format!("{cli_name} --dangerously-bypass-approvals-and-sandbox \"$(cat '{prompt_path}')\"") | ||
| /// `Some(session_id)` indicates that we want to resume that prior session. Unlike claude, | ||
| /// codex does not support assigning a session_id to a new conversation. | ||
| fn codex_command(cli_name: &str, session_id: Option<&Uuid>, prompt_path: &str) -> String { |
There was a problem hiding this comment.
at some point we might want to extract these command templates out from the binary into runtime config for flexibility (new cli options for permissions, customer/specific config etc) but not blocking
Add a Codex variant to ResumePayload, a TryFrom<ResumePayload> impl per harness so the runner only accepts its own typed *ResumeInfo, and a shared fetch_transcript_envelope helper consumed by both Claude and Codex. CodexHarness::fetch_resume_payload downloads + deserialises the stored rollout, the runner rehydrates the JSONL onto disk before launching the CLI, and codex_command issues 'codex resume <session_id>' on resume runs. REMOTE-1503 Co-Authored-By: Oz <oz-agent@warp.dev>
83ddb57 to
e1e49f0
Compare

Description
Following the pattern for resuming claude conversations, we add support for codex conversations.
These changes are pretty straightforward:
fetch_transcript_envelopeandentries_to_jsonlfrom the claude implementation and reuse/.codex/sessions/YYYY/MM/DD/...-<session_id>.jsonl)Screenshots / Videos
Demo: https://www.loom.com/share/fc40514af96649a9b35d3c85f2888627
Testing
Tested locally by running a codex cloud agent, closing it, and then using Safia's resume conversation script to trigger a followup message in that conversation.
Also added unit tests for writing the envelope.
Agent Mode