Skip to content

[Windows App][Goals/Compaction] File-backed active goal loses precedence to a completed user request after repeated compactions #46953

Open

Description

@a86582751

What version of the Codex App are you using?

  • Installed Windows desktop package: 26.915.4065.0.
  • Running Codex executable reports: codex-cli 0.155.0-alpha.9.2.
  • Model configured for the affected work: gpt-6-astra.
  • Observed on September 21, 2026 (UTC+08:00).
  • These versions were checked locally when preparing this report; the exact first affected version is unknown.

What subscription do you have?

Not included in this report.

What platform is your computer?

Windows 11 x64. PowerShell reports: Microsoft Windows NT 10.0.26200.0 x64.

What issue are you seeing?

During a long-running goal whose full objective is supplied through an attachment file, automatic context compaction repeatedly causes Codex to return to a previously completed ordinary user request, rather than continue the active goal. The revived request also loses its original conversational meaning.

This is not merely repeated text in the UI: the retrieved task history contains new assistant responses and new tool calls inspecting the old documentation topic. The first observed derailment also contains a file-change event and documentation checks.

Original request and its intended meaning

The preceding task created independent npm check commands and reworked the project's verification workflow. Codex reported that it had consolidated the documentation in docs/acceptance.md and docs/check-workflow-20260921.md, with only conclusions left in the roadmap.

I then asked:

变更日志、项目入口、operations.md、agent-start.md、AGENTS.md这些花样繁多的文档有相应说明吗?

In this context, I meant: Have the other project documents also been updated to describe the newly created npm checking workflow?

Codex initially understood this correctly. It said it would verify the current checking entry points, retirement of old workflows, and verification boundaries. It then reported fixing two outdated CI descriptions and one outdated checking command. That request was completed before the next goal began.

New, active goal

I subsequently set a new long-running goal:

把 NextTavern 统一成一个可安装、可启停、可升级、可卸载的插件入口

Translation: Unify NextTavern into one plugin entry that can be installed, enabled/disabled, upgraded, and uninstalled.

Because the goal text was long, the continuation instruction referenced an attachment rather than presenting the full goal as an ordinary conversational user message. The instruction had this form, with personal paths and the attachment identifier redacted:

Read the Codex goal objective file at
C:\Users\<user>\.codex\attachments\<attachment-id>\goal-objective.md
before continuing.

Codex successfully read the file and explicitly acknowledged the new plugin goal. Nevertheless, after automatic compaction it returned to the old documentation question and reinterpreted it as:

“Do the documents explain their own roles, reading order, and when each document should be updated?”

That is different from the original question about whether documentation of the new npm workflow was complete.

History-verified examples

A read-only inspection of the main task's history found at least three concrete transitions with this pattern. Times below are the containing turn's start–end times, not exact compaction timestamps, in UTC+08:00 on September 21:

Turn interval Work immediately before the recorded contextCompaction item First assistant response after compaction
04:20:54–04:26:09 Read the objective file and explicitly acknowledged the unified plugin goal and six compatibility migrations. “我先核对这些文档是否说明了各自用途、阅读顺序和更新边界;如果说明分散或缺失,就补到项目入口和文档目录里。”
04:52:36–05:22:50 Investigated plugin-market disable/restart behavior and restoration of host configuration. “我先核对这些文档是否已有职责和阅读顺序说明,再看是否需要补齐,尤其是哪些记录历史、哪些描述当前状态,以及改动后该更新哪一份。”
05:36:04–06:16:00 Worked on startup cancellation, unload cleanup, restoring native services, and frontend slot behavior. “我先核对这些文档的职责说明和入口链接,确认有没有明确写清‘各自管什么、什么时候更新、以哪份为准’。”

For all three containing turns:

  • The retrieved history shows a read of goal-objective.md.
  • It contains a contextCompaction item followed by the documentation-role response.
  • It contains no new userMessage item requesting that documentation work.
  • Codex subsequently used tools to read/search the documentation and ended with an answer about document responsibilities rather than the plugin goal's current execution state.
  • In the first example, Codex additionally created a documentation responsibilities table and linked it from the project entry and AGENTS.md; later examples rechecked and restated those responsibilities.

The history establishes repeated behavioral derailment across compaction boundaries. It does not establish whether the underlying model input duplicated a user message or whether the model misinterpreted retained historical text.

What steps can reproduce the bug?

Observed workflow; this has not yet been reduced to an independently deterministic minimal reproduction:

  1. Complete a coding task and its associated documentation.
  2. Send an ordinary follow-up asking whether other documents reflect that completed change. Let Codex complete it.
  3. Set a different, substantial long-running goal, long enough that the app supplies its objective through goal-objective.md and a “read the objective file before continuing” instruction.
  4. Let Codex progress through the goal until automatic context compaction.
  5. Observe whether the next assistant response restarts the most recent ordinary conversational request instead of continuing the active goal.
  6. Let the goal continue across additional compactions and check whether the same completed request is revived again.

The affected user also observes this tendency when the latest ordinary user instruction is sent after setting the file-backed goal, not only before it. This broader correlation is a user observation, not a controlled file-backed-vs-inline A/B test. The three concrete history examples above document the earlier-request case.

Relevant local configuration at diagnosis:

model = "gpt-6-astra"
model_context_window = 372000
model_auto_compact_token_limit = 350000

These are configuration values, not measurements of the actual token count at each compaction.

What is the expected behavior?

  • Preserve the active goal's identity, objective-file reference, current progress, and next unfinished action through compaction.
  • Keep completed/superseded conversational requests distinguishable from new input.
  • Do not promote the “last ordinary user message” into a fresh active instruction just because the actual current goal arrived through a file-backed continuation mechanism.
  • Preserve why an earlier request was made. Here, “update documentation for the new npm checking commands” must not become “explain the purpose of every documentation file.”
  • New user steering should update the ongoing goal appropriately; already handled steering should not restart at every later compaction.

Impact

Repeated documentation reads/checks and redundant explanations interrupt substantial implementation work, consume tokens and time, and require repeated manual correction. The first derailment also introduced documentation edits outside the intended immediate goal step. Replacing the last conversational message with an explicit reminder of the actual goal has been used as a mitigation, but is not evidence that the underlying issue is fixed.

Additional information

Related reports:

This report adds a concrete file-backed objective + completed documentation request case, three history-verified compaction transitions, and semantic drift in the revived instruction. It may share a root cause with those reports; please link or merge as appropriate.

Potential investigation area, not a confirmed diagnosis: goal/continuation state may be restored separately from ordinary user-message history, with the latter incorrectly treated as the current execution target after compaction. Checking goal ID, completed-request state, continuation trigger, and user-message identity across that boundary could distinguish actual message replay from model-level reinterpretation.

No claim is made that a specific recent PR introduced this issue. Raw private transcripts, local usernames, absolute workspace paths, private repository URLs, and source code are intentionally omitted. The affected user explicitly authorized submission; the excerpts were checked against the main conversation history without modifying or interrupting that task.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    contextIssues related to context management (including compaction)
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    model-behaviorIssues related to behaviors exhibited by the model
    on Sep 21, 2026
  2. github-actions commented on Sep 21, 2026

    @github-actions
    Contributor
  3. I3eka commented on Oct 7, 2026

    @I3eka

    What version of the Codex App are you using (From “About Codex” dialog)?

    A Codex App/About version was not captured for this related occurrence. The thread originated from codex-tui version 0.160.1 and records source: vscode; the interface used to set the later goal could not be established from the retained records. This is supporting evidence for the goal/compaction symptom, not a claim that the Windows App build from the original report was reproduced. Process and terminal-version evidence is included under Additional information.

    Recorded session cli_version: 0.160.1; installed CLI and running app-server also report 0.160.1 when checked on October 7, 2026. GitHub's latest stable release at this check is rust-v0.160.1, published October 5. The session was created October 6; the affected turn ran October 7.

    What subscription do you have?

    ChatGPT-authenticated account, plan type prolite. The affected turn records rate_limits.plan_type: prolite. An independent reporting-time check through the running Codex app-server (account/read, refreshToken: false, October 7, 2026) returned account.type: chatgpt and account.planType: prolite. The plan identifier is reported exactly as returned by Codex; no billing price or commercial plan variant is inferred.

    What platform is your computer?

    Execution host checked when preparing this report: Ubuntu 22.04.5 LTS. uname -mprs returned:

    Linux 5.15.0-185-generic x86_64 x86_64
    

    These are reporting-time workspace-host details. The operating system of any separate frontend/client was not captured in the incident record.

    What issue are you seeing?

    Related occurrence on October 7, 2026; full event timeline. My goal contained an inline objective plus an attachment with incident details and two screenshots. This differs from storing the entire objective in goal-objective.md, but the active task likewise arrived through native goal continuation.

    The prior ordinary question was answered at 09:08:05 UTC. The new goal began at 09:10:08 and produced findings. At 09:22:58, mid-turn compaction occurred. At 09:23:09, the agent returned to the old question's framing without any new user message. A successful get_goal then returned the correct active objective. The agent saved the goal's report, moved the screenshots and marked it complete, but the final answer still led with the older question. This is partial task drift rather than complete abandonment of the goal.

    What steps can reproduce the bug?

    Observed workflow; no independent deterministic minimal reproducer has been established:

    1. Complete an ordinary question A in a long-running session.
    2. Set a distinct goal B. In this case the objective referenced an attachment with incident details and two screenshots. It was supplied through native goal continuation, not a new ordinary chat message.
    3. Let Codex investigate B until automatic mid-turn compaction.
    4. Observe whether its first response and final answer return to A even though B remains active and readable through get_goal.

    No new ordinary user message arrived between setting B and its final answer. Correlation identifiers and token/context counts are included below.

    What is the expected behavior?

    After compaction, the active goal should remain the current task. A completed earlier question should remain historical. If goal state needs refreshing, retrieve and reconcile it before choosing the next action or framing a response. Retrieving the correct active goal should not leave an unrelated completed question as the lead task in the final answer.

    Additional information

    gpt-6-astra, reasoning effort xhigh, provider openai, collaboration mode default. The model and effort are unchanged across the affected compaction.

    The thread originated from codex-tui version 0.160.1, with recorded source: vscode. The current read-only thread/read response confirms these values. A still-running Codex TUI process in the affected workspace started within one second of thread creation; it runs in a herdr-managed PTY and inherited TERM_PROGRAM=vscode, TERM_PROGRAM_VERSION=1.134.0. This is supporting process evidence, not proof of which frontend was used to set the later goal.

    Reporting-time codex doctor instead sees VS Code 1.138.0 in its environment. These terminal environment values do not establish a Codex extension/App build. The exact interface and build used when goal B was set were not captured, so this is not presented as a controlled CLI-only reproduction or a confirmed Windows App occurrence.

    Recorded context window: 258400 tokens; no token budget was recorded for the goal. Recorded approval policy: on-request; sandbox: workspace-write, network_access: false. These historical values are distinguished from the current doctor snapshot.

    thread_id: 01a11081-bae3-7843-ac30-3d083b1f8e4a
    goal_turn_id: 01a115a0-97f0-7e32-843e-94c1fc4ea09e
    compaction_response_id: resp_0884ad102bae5a5e016ac60ec08d2087d2aec9f81dc1ef2221
    history_mode: paginated
    compacted.window_number: 9
    

    This was the ninth recorded compaction in the thread; this report analyzes one specific transition. The resumed turn ID, model, and reasoning effort match the pre-compaction goal turn. The identifiers above are included for correlation; private account and attachment identifiers remain omitted.

    • Replacement history: 33 items, comprising 29 user messages, 3 developer messages and 1 opaque encrypted compaction item.
    • No explicit <codex_internal_context source="goal"> message remained; the objective's opening sentence and attachment ID were absent from its readable messages.
    • The last retained user message was the already answered question, “и это возможно исправить?” (“and can this be fixed?”).
    • First goal request: 189,435 input tokens / recorded window 258,400, about 73%. Last ordinary response before compaction: 220,988 input tokens. Compaction-response input: 226,794 tokens. These are request counts, not the UI indicator, cumulative goal usage, or a proven compaction threshold.
    • The encrypted compaction content cannot be inspected from this rollout, so absence from readable history does not prove absence from every part of model context.

    A current full, redacted codex doctor --json report is included in the primary comment. It was collected on 2026-10-07 10:15:30 UTC and reported overallStatus: ok; it does not establish that the compaction issue is fixed.

    Related reports: #31659, #32922, and #46953. Matching symptoms do not by themselves establish an identical code-level cause. Raw private transcripts, internal addresses, account names, phone numbers, credentials, attachment IDs, and absolute local paths are omitted.

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

    appIssues related to the Codex desktop appbugSomething isn't workingcontextIssues related to context management (including compaction)model-behaviorIssues related to behaviors exhibited by the modelsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions