Repository navigation
[Windows App][Goals/Compaction] File-backed active goal loses precedence to a completed user request after repeated compactions #46953
Description
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
contextCompactionitem followed by the documentation-role response. - It contains no new
userMessageitem 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:
- Complete a coding task and its associated documentation.
- Send an ordinary follow-up asking whether other documents reflect that completed change. Let Codex complete it.
- Set a different, substantial long-running goal, long enough that the app supplies its objective through
goal-objective.mdand a “read the objective file before continuing” instruction. - Let Codex progress through the goal until automatic context compaction.
- Observe whether the next assistant response restarts the most recent ordinary conversational request instead of continuing the active goal.
- 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 = 350000These 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:
- Compaction resume incorrectly presents stale latest user prompt as current active instruction #27731 — Compaction resume incorrectly presents stale latest user prompt as current active instruction.
- Old goal-generation instruction resurfaces after context compaction #42051 — Old goal-generation instruction resurfaces after context compaction.
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
github-actions commentedon Sep 21, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I3eka commentedon Oct 7, 2026
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-tuiversion0.160.1and recordssource: 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 report0.160.1when 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 recordsrate_limits.plan_type: prolite. An independent reporting-time check through the running Codex app-server (account/read,refreshToken: false, October 7, 2026) returnedaccount.type: chatgptandaccount.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 -mprsreturned: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 at09:10:08and produced findings. At09:22:58, mid-turn compaction occurred. At09:23:09, the agent returned to the old question's framing without any new user message. A successfulget_goalthen 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:
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 effortxhigh, provideropenai, collaboration modedefault. The model and effort are unchanged across the affected compaction.The thread originated from
codex-tuiversion0.160.1, with recordedsource: vscode. The current read-onlythread/readresponse confirms these values. A still-running Codex TUI process in the affected workspace started within one second of thread creation; it runs in aherdr-managed PTY and inheritedTERM_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 doctorinstead seesVS Code 1.138.0in 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:
258400tokens; 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.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.
<codex_internal_context source="goal">message remained; the objective's opening sentence and attachment ID were absent from its readable messages.A current full, redacted
codex doctor --jsonreport is included in the primary comment. It was collected on 2026-10-07 10:15:30 UTC and reportedoverallStatus: 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.