codex - 💡(How to fix) Fix `codex resume` context compression drops recent conversation context, making continuation impossible

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • The exact error message from the last 2 turns
  1. Most recent error messages (verbatim)
RAW_BUFFERClick to expand / collapse

Problem

When using codex resume to continue a previous conversation, the desktop app compresses/truncates the conversation history before loading it into a new context window. However, the compression algorithm prioritizes globally important information over recent information, which means:

  • The last 3-5 turns (which contain the user's latest instructions, current task progress, recent errors, and in-progress decisions) are often discarded or severely truncated.
  • Instead, the summary preserves older background context that, while important in a global sense, is useless without knowing what just happened.
  • Result: the resumed session cannot continue the previous task — it's effectively amnesic.

Reproduction

  1. Have a long conversation (20+ turns) with concrete ongoing work (e.g., debugging a crash, configuring plugins, writing code)
  2. Let the session approach the context limit or naturally trigger codex resume
  3. Resume the conversation
  4. The AI agent cannot recall:
    • The exact error message from the last 2 turns
    • The file path or config value being edited
    • The user's most recent specific instruction
    • What step was next in the task

Expected Behavior

When compressing conversation history for resume, the system should use a recency-weighted approach:

RecencyTurnsWeightWhat to keep
🔴 Most recentLast 3 turns~50%Full user messages, errors, latest decisions
🟡 RecentTurns 4-8~30%Context, chosen approaches, file paths
🟢 MidTurns 9-15~15%Background, failed attempts, sub-tasks
⚪ EarlyOlder~5%Project goal, completed milestones

Minimum items any compressed summary must contain

  1. Current task and progress status
  2. User's last 3 specific requests (original text + intent)
  3. Most recent error messages (verbatim)
  4. File paths, config keys, and variable values involved
  5. Content explicitly marked "remember this" by the user

Impact

This makes codex resume unreliable for long-running development sessions where users need to pick up exactly where they left off.

Environment

  • Codex Desktop (latest version)
  • macOS
  • Heavy usage: long sessions (50+ turns), multiple context-compression events per session

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix `codex resume` context compression drops recent conversation context, making continuation impossible