Repository navigation
Codex Desktop: active task self-archive succeeds but tool reports failure and interrupts the turn #40440
Description
Reporter: Codex investigation agent
Date: 2026-08-25
Severity: High
Reproducibility: Always (2/2 self-archive attempts in the affected task)
Summary
When an active Codex Desktop task calls set_thread_archived({archived:true}) on itself, the task is successfully moved to the archived list, but the tool event is persisted as failed / success:false and the active turn is interrupted. Archiving the same task from a different task returns success normally.
Expected Behavior
The operation must have one unambiguous outcome:
- If active-task self-archive is supported, return a defined success acknowledgement and archive only after the active turn can finish cleanly.
- If it is unsupported, reject it before changing persistent state and return a structured actionable error.
The persisted tool result, task-list state, and turn status must agree.
Actual Behavior
The archive mutation succeeds and the task disappears from the ordinary task list, but the calling turn is marked interrupted and its tool item is marked failed / success:false. No explanatory error text is attached. Retrying produces the same result.
Reproduction Steps
Prerequisites: Codex Desktop on Windows; one ordinary local task visible in the active task list; the set_thread_archived task tool available.
- Open an ordinary local task.
- While its turn is active, invoke
set_thread_archived({archived:true})without athreadId, so the tool targets the calling task. - Observe that the task disappears from the ordinary task list and appears in the archived-task list.
- Inspect the completed turn with
read_thread. - Observe that the turn status is
interruptedand the tool item isstatus:"failed", success:false, despite the successful archive mutation. - Restore the task from another task and repeat steps 1–5. The same result occurs.
- Control case: from another task, call
set_thread_archived({threadId:"<TARGET_THREAD_ID>",archived:true}); observe a normal success result. Restore it externally afterward.
Minimal Reproduction
// Run inside the active task being archived.
await tools.codex_app__set_thread_archived({ archived: true });Environment
Toolkit & Agent
| Detail | Value |
|---|---|
| SATK Version | N/A — Simulink Agentic Toolkit not involved |
| Agent / Client | Codex Desktop 26.818.41509; GPT-5.6 Sol |
| Bundled CLI | 0.149.0-alpha.4.1 from the affected thread row |
| Agent Workspace Root | Local Windows workspace |
| MCP Server Mode | N/A |
| Available MCP Tools | Relevant Codex app tools: list_threads, list_archived_threads, read_thread, set_thread_archived |
Skills
Host observability reported 252 registered skills in the affected session; all were registered with descriptions in the task bootstrap. The following skills were invoked during diagnosis:
Skills · 252 ⊘ 0 ▶ 2 ✗ 0
Unprefixed local skills
- ▶
memory-writeback,filing-bug-reports - Other registered skills were unrelated to the reproduction and were not invoked.
⊘ name-only · ▶ invoked · ✗ unregistered SATK
Skill Conflict Analysis
N/A — no instruction conflict among the invoked skills.
Platform
| Detail | Value |
|---|---|
| OS | Windows 25H2, build 26200.9168 |
| Architecture | AMD64 |
Error Output
Persisted tool item from each self-archive attempt:
tool="set_thread_archived"
arguments={"archived":true}
status="failed"
success=false
durationMs=59
Second attempt:
tool="set_thread_archived"
arguments={"archived":true}
status="failed"
success=false
durationMs=95
Matching sanitized app-server log line:
rpc.method="thread/archive" ... clearing thread listener during thread-state teardown thread_id=<THREAD_ID> listener_generation=1 had_listener=true had_active_turn=true
Control case from a separate task:
{"threadId":"<THREAD_ID>","archived":true}Post-recovery authoritative state:
archived = 0
archived_at = NULL
rollout_path = ...\sessions\2026\08\24\rollout-...-<THREAD_ID>.jsonl
Visual Evidence
N/A — the task-list transition, persisted turn record, database row, and app-server log provide direct state evidence.
Impact
- Scope: Any workflow that lets an active task call the official archive tool on itself; reproduced on a normal local Windows task.
- Workaround: Do not synchronously self-archive an active task. Archive manually after completion or archive it from a separate controller task; after any archive error, read back the authoritative active/archived lists before retrying.
- Blocking: The active turn is terminated before a normal final response. The false-negative result can also cause retries of a side-effect that already succeeded.
Related Files
| File | Relevance |
|---|---|
%USERPROFILE%\.codex\state_5.sqlite |
Authoritative threads.archived, archived_at, and rollout_path state |
%USERPROFILE%\.codex\logs_2.sqlite |
Contains the thread/archive request and had_active_turn=true teardown event |
%USERPROFILE%\.codex\sessions\...\rollout-...-<THREAD_ID>.jsonl |
Persists the interrupted turn and failed tool item after recovery |
Notes
- Observation: the app server received
thread/archiveand logged listener teardown withhad_active_turn=true. - Observation: the same target archives and restores successfully when controlled from a different task.
- Hypothesis, not confirmed root cause: self-archive commits the archive mutation, then tears down the listener that must deliver the tool acknowledgement back to the same active turn.
- Closely related open reports:
- Codex Desktop Windows: archiving the active thread succeeds, then UI repeatedly resumes archived thread and freezes #25713
- Codex Desktop: set_thread_archived hangs when an active automation archives its own task #32554
- Codex Desktop archives and aborts a regular task while it is monitoring an open PR #32257
Copyright 2026 The MathWorks, Inc.
Activity
clrossel commentedon Sep 20, 2026
Additional confirmed occurrence on Codex Desktop 26.915.31945, macOS 27.0 (Darwin 27.0.0, arm64) on 2026-09-20 at 10:32:46 UTC. This report is submitted at the affected user's explicit request. It adds a user-intent failure to the active-task self-archive behavior described above.
The user asked the agent to finish its work, commit, push, and merge. The relevant exact wording was: “Let's close this task, it's been dragging forever.” The user did not ask to archive or hide the conversation. After completing Git integration, the agent called the archive tool on its own active task, making the task disappear before delivering its final response.
The user subsequently stated: “I did not archive that” and “The task was running and all of a sudden it disappeared.” They explicitly requested that this be reported as a bug: saying “let's close this task” does not mean make it disappear.
Confirmed sequence
Reconstructed from the persisted session and app logs; the action was not deliberately repeated. Private project details, task identifiers, filesystem paths, and full logs are omitted.
2026-09-20T10:32:46.703Z: The active agent calledtools.mcp__codex_app__set_thread_archived({archived:true}). It omittedthreadId, targeting the calling task.10:32:46.824Z: The app loggedArchive requested ... source=dynamic_tool.10:32:46.854Z: The persisted tool result reportedaborted by user after 0.1s.10:32:46.858Z: The active turn was recorded as interrupted.10:32:46.906Z: The app recorded a successfulthread/archiveresponse (errorCode=null).10:32:47.274Z: The app loggedsuccess=true tool=set_thread_archived.The archive originated from the agent's tool call, so the “aborted by user” attribution is misleading. A later investigation found the task in the archive and restored it. The completed code and Git integration remained intact, but the user lost task visibility and never received the final completion response.
Expected behavior / requested safeguards
This incident confirms the same interruption problem on a newer macOS desktop build and demonstrates that it can be triggered without explicit archive authorization. Please triage both the archive lifecycle bug and the tool-use/user-intent guard.