Skip to content

Codex Desktop: active task self-archive succeeds but tool reports failure and interrupts the turn #40440

Open

Description

@NANMINGZHIYUAN

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.

  1. Open an ordinary local task.
  2. While its turn is active, invoke set_thread_archived({archived:true}) without a threadId, so the tool targets the calling task.
  3. Observe that the task disappears from the ordinary task list and appears in the archived-task list.
  4. Inspect the completed turn with read_thread.
  5. Observe that the turn status is interrupted and the tool item is status:"failed", success:false, despite the successful archive mutation.
  6. Restore the task from another task and repeat steps 1–5. The same result occurs.
  7. 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


Copyright 2026 The MathWorks, Inc.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    app-serverIssues involving app server protocol or interfaces
    on Aug 24, 2026
  2. clrossel commented on Sep 20, 2026

    @clrossel

    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 called tools.mcp__codex_app__set_thread_archived({archived:true}). It omitted threadId, targeting the calling task.
    • 10:32:46.824Z: The app logged Archive requested ... source=dynamic_tool.
    • 10:32:46.854Z: The persisted tool result reported aborted by user after 0.1s.
    • 10:32:46.858Z: The active turn was recorded as interrupted.
    • 10:32:46.906Z: The app recorded a successful thread/archive response (errorCode=null).
    • 10:32:47.274Z: The app logged success=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

    1. Require clear archive intent. “Close this task,” “finish this,” or similar completion language should mean finish the work and report the result, without removing the conversation from the active task list. Do not infer permission to archive from that wording.
    2. Prevent active self-archive from interrupting completion. Reject it before changing state, or defer a clearly authorized archive until the final response is durably delivered.
    3. Report interruption provenance accurately. Distinguish an agent-triggered archive from a user-issued stop, and make the tool result agree with the persistent archive state.

    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.

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 appapp-serverIssues involving app server protocol or interfacesbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions