Skip to content

Fixing codex resume#878

Open
Soph wants to merge 8 commits intomainfrom
soph/codex-resume
Open

Fixing codex resume#878
Soph wants to merge 8 commits intomainfrom
soph/codex-resume

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented Apr 8, 2026

entire resume for codex also needs to use the right path and also has a few constraints on encrypted parts in the logs that are not transferable since the decryption can only happen on the source machine.

but with this entire resume works now for codex sessions


Note

Medium Risk
Medium risk: changes how restored Codex transcripts are located/written (glob search + canonical nested paths) and mutates restored transcript contents, which could break resume if path parsing or sanitization is incorrect.

Overview
Fixes Codex session restoration so entire resume writes restored transcripts to a canonical, date-sharded ~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<id>.jsonl path derived from the transcript’s session_meta timestamp, enabling codex resume <id> to rediscover the rollout.

Adds a new optional agent capability RestoredSessionPathResolver, used during logs-only restore to override the default ResolveSessionFile target path when an agent needs transcript-aware placement.

Improves Codex restored transcript compatibility by sanitizing restored rollouts before writing: strips encrypted_content from reasoning items and drops compaction / compaction_summary entries (including inside compacted.replacement_history). Includes tests for nested rollout lookup, restored path resolution, transcript sanitization, and resume command display output.

Reviewed by Cursor Bugbot for commit f797c46. Configure here.

@Soph Soph requested a review from a team as a code owner April 8, 2026 19:46
Copilot AI review requested due to automatic review settings April 8, 2026 19:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes entire resume for Codex sessions by restoring transcripts to Codex’s canonical rollout location (so codex resume <id> can rediscover them) and sanitizing restored transcripts to remove encrypted/log fragments that cannot be replayed off the source machine.

Changes:

  • Add an agent capability (RestoredSessionPathResolver) so restore logic can ask agents for the correct restored transcript path.
  • Update Codex agent path resolution to (a) locate nested rollouts and (b) compute the canonical restored rollout path from transcript start time; sanitize restored transcripts to strip encrypted/compaction artifacts.
  • Add targeted tests for Codex resume command display, restored path resolution, and transcript sanitization.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cmd/entire/cli/strategy/manual_commit_rewind.go Uses the new agent capability to choose a transcript-specific restore path when rebuilding sessions from checkpoint data.
cmd/entire/cli/resume_test.go Adds a regression test ensuring restored Codex sessions show a codex resume <id> continuation command.
cmd/entire/cli/agent/codex/transcript.go Adds transcript sanitization for restored rollouts and registers Codex as supporting restored-path resolution.
cmd/entire/cli/agent/codex/transcript_test.go Tests that sanitization removes encrypted content and compaction entries (including within compacted history).
cmd/entire/cli/agent/codex/codex.go Implements canonical restored rollout path computation, nested rollout discovery, and writes sanitized restored transcripts.
cmd/entire/cli/agent/codex/codex_test.go Adds tests for canonical restored rollout path computation and nested rollout discovery.
cmd/entire/cli/agent/agent.go Introduces RestoredSessionPathResolver interface to support agent-specific restored transcript locations.

@Soph Soph force-pushed the soph/codex-resume branch 3 times, most recently from f5759d8 to 5c3b886 Compare April 9, 2026 10:49
@Soph Soph force-pushed the soph/codex-resume branch from 59a7f43 to 09af656 Compare April 9, 2026 16:05
Soph added 8 commits April 9, 2026 18:19
Entire-Checkpoint: 8cdcce4b4b76
Entire-Checkpoint: 84f89ae1b99b
… restore anyhow

Entire-Checkpoint: a77fe7632f93
Entire-Checkpoint: 0ea4805786bc
Entire-Checkpoint: 34470e766f9e
Entire-Checkpoint: 39b82e835037
@Soph Soph force-pushed the soph/codex-resume branch from f27f2cd to 8078b5e Compare April 9, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants