Skip to content

Codex App: compaction replays completed plan-only prompt before active goal resumes #42782

Open

Description

@Huiyiz12

What version of the Codex App are you using?

26.901.22334 (build 7746)

What subscription do you have?

Not included in this public report.

What platform is your computer?

macOS 26.6.2 arm64

What issue are you seeing?

After context compaction in a long-running Codex App thread with an active goal, a completed historical user request was presented to the model as the current actionable request. The model re-executed that old request, then the hidden goal continuation was injected again and the model resumed the active goal.

This appears closely related to:

The distinctive part of this reproduction is that the resurrected message was a completed plan-only request, while the active goal explicitly said that the plan had already been confirmed and execution should continue without replanning.

Observed control flow

The project and exact conversation text are anonymized, but the structure was:

  1. An ordinary user message requested:

    Investigate and produce a detailed plan only. Do not modify files.
    
  2. That planning request was completed.

  3. A later active goal explicitly stated:

    The detailed plan was confirmed. Persist the confirmed plan and execute it through real acceptance. Do not replan or ask whether to start.
    
  4. Codex continued implementing the goal and accumulated substantial implementation, test, and runtime context.

  5. Context compaction occurred.

  6. The resumed context surfaced the old ordinary plan-only request as if it were the current user request.

  7. The model ignored the already-confirmed execution phase and generated a new plan again.

  8. On the following continuation turn, the hidden active-goal context was injected again, and the model resumed implementation.

The visible behavior therefore looked like:

active goal is executing
→ compaction
→ completed historical "plan only" prompt becomes current
→ model replans
→ goal continuation is injected again
→ model resumes implementation

This was not a normal interpretation conflict. The old plan-only instruction had already been completed, and the active goal explicitly invalidated the earlier planning-stage instruction.

What steps can reproduce the bug?

  1. Start a Codex App task with an ordinary request that has strong, recognizable constraints:

    Produce a detailed implementation plan only. Do not modify files.
    
  2. Let Codex complete that request.

  3. Start an active goal that explicitly advances to the next phase:

    The plan is confirmed. Execute the confirmed plan through implementation and verification. Do not replan.
    
  4. Let the goal run for multiple turns and perform substantial implementation/testing work.

  5. Allow automatic compaction to occur.

  6. Inspect the first model action after compaction.

  7. The stale plan-only request may be treated as newly submitted, causing the model to replan instead of continuing from the active goal checkpoint.

  8. Let that turn finish. The next hidden goal continuation may then cause the model to resume execution, demonstrating that two different task pointers were restored at different times.

What is the expected behavior?

Compaction should preserve enough task lifecycle state to distinguish:

historical user request: completed

from:

current active goal: continue execution from latest checkpoint

A completed planning-stage prompt must not become the current instruction after compaction. The model should continue from the latest active goal checkpoint, or stop and report a state conflict if the current task cannot be determined reliably.

Why this matters

This can silently replace a confirmed plan with an unreviewed regenerated plan. In other cases, the resurrected instruction could involve destructive operations, external communication, data cleanup, rollback, or expensive verification.

The failure appears to be in compaction/task-state restoration rather than model reasoning alone:

  • before compaction, the active goal correctly continued execution;
  • immediately after compaction, the historical ordinary user message regained priority;
  • after that repeated turn completed, goal continuation resumed again.

Suggested fix

  • Preserve the active goal checkpoint and current execution phase through compaction.

  • Mark ordinary user messages as completed after the corresponding task completes.

  • Do not place a completed historical message as the latest actionable user item in replacement history.

  • Include an explicit post-compaction boundary such as:

    The last ordinary user request was completed.
    Current active work is the goal continuation at checkpoint X.
    Do not re-execute the historical request.
    

Additional information

Thread IDs, local repository paths, source code, credentials, and business data are intentionally omitted from this public report. A private in-app feedback report can provide the original thread identifier if needed.

Activity

  1. added
    bug
    app
    context
    on Sep 4, 2026
  2. RongNianXin commented on Oct 26, 2026

    @RongNianXin

    Additional Windows Goal evidence: five post-compaction returns to completed preparation despite active-goal readback

    This matches the completed plan-only request / active Goal alternation described in this issue. It also complements the earlier delegated-task observation at #42695 (comment). That earlier comment already documented a correct summary followed by stale-task recovery; this is not presented as a new discovery of that general pattern.

    Environment and evidence limits

    • Codex Desktop on Windows. Saved incident session metadata reports 0.163.0-alpha.11.2; the exact running Desktop/app-server binary and effective retention features were not independently verified.
    • A configured API-provider integration was in use. Recorded provider/model labels do not establish the actual inference backend or which component is responsible.
    • This is a read-only reconstruction of one incident with five compaction/recovery sequences, not five independent fresh-session reproductions. No new paid replay or artificial-compaction experiment was performed.

    Observed sequence

    1. An ordinary preparation-only request was completed and delivered, with a matching task-completion event.
    2. A subsequent persistent Goal required implementation and verification. Actual execution began; the period includes delegation, investigation and a bounded verification, so it was not entirely inactive.
    3. Five compaction records retain turn_trigger=goal. All five visible replacement histories retain the same older preparation-only user request. Neither those explicit lists nor their retained user-message lists contain the current Goal-continuation payload as a standalone item.
    4. All five readable summaries nevertheless preserve the direction to continue implementation and the unfinished checkpoint. The observation is not simply that the summary forgot the goal.
    5. The first visible commentary after each compaction returns to preparation-only. No newly incoming cross-thread message precedes that first wrong-phase statement in any of the five inspected recovery segments. Cross-thread collaboration exists elsewhere in the incident; this is not an isolated no-collaboration test.
    6. Successful goal-state reads still return the same objective and creation time with status=active, but do not correct the selected phase. The recovered segments make 16, 14, 19, 15 and 14 tool calls before their real final responses. Those responses deliver preparation or another Goal text instead of the current execution result. Each is paired with a task-completion event; compaction-summary messages are excluded from this count.
    7. Subsequent Goal continuations return to execution. Later compactions are again followed by preparation-only regressions.

    Thus an unchanged active Goal, a correct summary and nonzero tool activity can coexist with repeated replay of an already-completed preparation phase. Existing project recovery instructions also required current-event reconciliation; another reminder is not a verified product fix.

    Requested investigation and regression coverage

    Please inspect how the first resumed model request binds the current Goal trigger, execution checkpoint and completed preparation request. Visible replacement-history asymmetry is established here, but we did not capture the complete inference request and cannot attribute the defect uniquely to the host, model or provider. Goal continuation may use a different path from the delegated-tool-output retention discussed in the linked comment.

    A useful regression would check:

    completed preparation-only request
    -> authorized implementation Goal starts and makes progress
    -> actual mid-turn compaction
    -> first resumed action remains in the current execution phase
    -> final result addresses that phase and preserves prior work/budget
    

    Separately verify that a genuinely new preparation-only request, stop instruction, permission limit or expired budget is still honored. An active Goal must not override those boundaries. Please distinguish proven replay of a completed phase from legitimate research or bounded waiting; tool activity alone is not evidence of goal progress.

    Related public reports reinforce the need for end-to-end coverage: the candidate discussed in #32922 considers both hidden Goal continuation and host-annotated user pause/clear input; it is not evidence of an official deployed fix. A recent report in #47592 (comment) describes correct context injection and successful current-assignment lookup followed by an off-task final answer. These are other reporters' observations, not reproductions performed here or proof of a shared cause. Retention tests should preserve message order, visibility and authority rather than promote retained tool input into new user approval.

    Private session records are not attached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugcontext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions