Compaction resume incorrectly presents stale latest user prompt as current active instruction
Summary
After context compaction, Codex appears to surface the most recent user prompt as if it were newly submitted, even when that prompt is stale and many actions, tool calls, plan updates, or additional compactions have happened since.
This causes the resumed model to treat old instructions as the current user request, which can derail long-running tasks.
Observed Behavior
In long-running threads:
- User sends prompt A.
- Codex performs substantial work after prompt A.
- Context compacts.
- The resumed model sees prompt A as the latest/current user instruction.
- The model acts as though prompt A was just sent, despite it being historical context.
This can repeat across multiple compactions.
Expected Behavior
After compaction, the resume context should distinguish:
- historical user prompts,
- the actual latest active instruction,
- work completed after that instruction,
- current task state,
- whether a prompt is stale/inherited history or newly submitted.
The model should not infer that the most recent user prompt in the compacted transcript is active unless it is actually the latest post-resume instruction.
Impact
This creates serious failure modes for long-running coding/recovery tasks:
- stale instructions override newer completed work,
- old plans are restarted,
- the assistant repeats or reverses prior steps,
- compaction appears to sever task continuity,
- user has to repeatedly re-explain that the prompt is old.
Suggested Fix
The compacted context should include an explicit boundary marker such as:
The following user prompt is historical and was already acted on.
Do not treat it as newly submitted.
Current active task state is: ...
Latest post-compaction user instruction is: ...
Or preserve a durable active-instruction pointer separate from the raw latest user message.
Repro Pattern
Any long-running Codex thread with repeated compactions and substantial work after the last user prompt can trigger this. The issue is easiest to observe when the old prompt contains strong imperative language, because the resumed model treats it as current.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗