Codex Desktop rehydrates nonexistent historical subagents as active whenever an affected task is opened

Open 💬 7 comments Opened Aug 5, 2026 by HALWEBI9000

Summary

On Codex Desktop for macOS, opening an affected long-running task causes many historical child agents to be displayed again as Working (作業中). This happens every time the task is opened.

Attempts to stop or close the displayed agents return thread ... not found, so the visible active state and the lifecycle/control API disagree. Updating Codex Desktop, restarting the app, and rebooting macOS do not clear the condition. The same symptom has occurred in at least two independent long-running tasks.

This is not just a cosmetic stale badge: the user cannot determine whether agents are actually running, whether resources are still being consumed, or whether stop controls have taken effect. Multi-agent use has therefore been disabled for the affected workflows.

Environment

  • Product: Codex Desktop app for macOS
  • App version: 26.730.61639 (build 6234)
  • Bundled CLI: codex-cli 0.147.0-alpha.1.2
  • OS: macOS 26.5.2 (build 25F84)
  • Architecture: arm64
  • Affected scope: at least two independent, long-running project tasks

Steps to reproduce

The problem is reliable for the affected tasks, although I do not yet have a small fresh-task reproducer.

  1. Open an affected long-running task in Codex Desktop.
  2. Observe the Subagents panel.
  3. Many historical subagents immediately appear as Working, including repeated historical names.
  4. Attempt to stop/close the displayed agents.
  5. Observe that the control operation returns errors equivalent to:

``text
thread <id> not found
``

  1. Leave and reopen the same task.
  2. Observe that the historical agents are shown as Working again.
  3. Restart Codex Desktop, or reboot macOS and reopen the task.
  4. Observe that the condition returns.

The same pattern has been observed in another independent long-running project task on the same Mac.

Actual behavior

  • Merely opening the affected task rehydrates many historical/nonexistent child agents into a visible Working state.
  • Stop/close operations cannot resolve them because the corresponding thread is not found.
  • App restart, app update, and full OS reboot do not repair the task state.
  • The UI does not distinguish actually running agents from stale historical entries or non-resolvable lifecycle records.
  • The user has no trustworthy way to know whether work or resource consumption continues.

Expected behavior

  • Loading a task must preserve terminal child-agent states.
  • A nonexistent or already-closed child must never be displayed as active.
  • The UI and runtime API must agree on lifecycle state.
  • Stop/close should be idempotent and return a terminal result such as already closed; not active rather than leaving an active badge behind.
  • The app should distinguish at least active, completed/retained, and stale/non-resolvable states.
  • A task-level resync/repair agent state action should be available when local UI state and backend lifecycle state diverge.

Persistence and recovery attempts

The following did not resolve the issue:

  1. Stopping the displayed agents individually.
  2. Leaving and reopening the affected task.
  3. Restarting Codex Desktop.
  4. Updating Codex Desktop to the version listed above.
  5. Rebooting macOS.

Sanitized diagnostic observations

  • One affected long-running task had approximately 151 historical child-session records during local reconciliation.
  • Stop/close attempts against those historical entries returned not_found.
  • The corresponding parent rollout/history was unusually large (approximately 17 GB). This is included as a possible trigger or stress factor, not as a claimed root cause.
  • The visible trigger is task loading: opening the affected task causes the stale Working states to appear again.
  • Because the tasks contain confidential project data, raw rollout files and uncropped screenshots are not attached. Sanitized screenshots limited to the Subagents panel can be provided.

These observations support a task-load rehydration or lifecycle-state reconciliation defect. They do not prove that 151 agents are actually executing.

Impact

  • The execution state shown by the primary control surface cannot be trusted.
  • Stop/cancel effectiveness cannot be verified.
  • Users cannot safely distinguish active work from stale UI state.
  • Multi-agent workflows become unusable for long-running tasks.
  • Users are forced to migrate work to a new task and avoid subagents, losing continuity and parallelism.
  • For confidential or state-changing workflows, ambiguous invisible execution is a safety and governance concern.

Related issues

This report adds a current macOS/Desktop regression pattern: the issue survives application update and OS reboot, affects multiple tasks, and is re-triggered every time the affected task is opened.

Suggested fix direction

  1. On task load, reconcile child-agent UI state against authoritative runtime state before showing Working.
  2. Never infer active state from historical spawn records alone.
  3. Make stop/close idempotent and return authoritative active, already terminal, or unknown/stale status.
  4. Add counts_toward_limit and last_authoritative_state_at fields to agent diagnostics.
  5. Add an in-app repair/resync action for corrupted or stale agent-state projections.
  6. Add regression coverage for long histories, app restart, OS reboot, and repeated task reopen.

Additional information available on request

  • Cropped screenshots showing only the Subagents panel
  • Approximate timestamps of app restart/reboot/reopen reproduction
  • A redacted list of lifecycle control results
  • Sanitized state summaries that exclude project names, prompts, file paths, and document contents

View original on GitHub ↗

7 Comments

nishant32f · 20 days ago

Additional reproducible datapoint from Codex Desktop on Linux. This is the second occurrence for this user/task workflow.

Environment:

  • OS: Pop!_OS 24.04 LTS, Linux x86_64
  • Codex CLI currently: 0.147.0
  • Affected subagent session metadata was created under Codex Desktop / CLI 0.144.4
  • Long-running parent task with multiple brainstorm, plan, review, and fix waves

Observed on 2026-08-08 (Asia/Kolkata):

  • The Subagents panel displayed exactly 18 historical agents as is working.
  • Those 18 entries mapped exactly to child session metadata accumulated across earlier completed waves: 14 reviewers and 4 implementation workers.
  • Parent rollout records contain successful close_agent calls whose returned previous_status was completed for these agents.
  • Reissuing close_agent against all 18 IDs now returns agent with id ... not found from codex_core::tools::router.
  • Local process inspection shows only the expected Codex app-server/proxy/code-mode-host processes, not 18 executing child processes.
  • The UI therefore reports active work while the authoritative live registry has no corresponding agents.
  • A prior local state backup named for stale-agent repair confirms this is a recurrence rather than the first incident.

Impact:

  • The user cannot trust whether background work is actually executing.
  • The agent initially misreported the panel as stale without verification because no list/status API is exposed; only ID-based close/wait calls are available.
  • Restart/reopen is only a cosmetic workaround and does not address the parent/child state projection defect.

This Linux recurrence supports the issue's proposed root cause: parent-task restoration is rendering historical spawn/session records as active without reconciling them against terminal rollout events or the live agent registry.

Additional requested diagnostics can be provided in sanitized form. The affected project contents and prompts are private and are intentionally omitted.

leadingproblemsolver · 20 days ago

The cross-platform recurrence makes this look like a restoration contract problem rather than a renderer-only cache bug.

I would treat every persisted child-agent row on task load as historical evidence to reconcile, not as a liveness record that can be replayed directly into Working.

A child can carry separate fields such as:

child_id
spawn_generation
last_terminal_event = completed|closed|failed|null
last_terminal_event_at
live_owner_epoch|null
last_reconciled_at

Then task restoration can use a monotonic rule:

terminal evidence exists           => terminal, never Working
live registry/lease confirms child => active
neither                            => stale/unknown, never Working by default

That is important because historical spawn edges are append-only facts: they prove the child once existed, not that it is executing now. A reboot cannot make that old fact current again.

The existing close_agent -> not found result is also useful reconciliation evidence. close should be idempotent at the control-plane level: if the live registry has no child and durable history already shows terminal completion, return already_terminal and repair the projection rather than leaving a Working badge.

I would add one recovery fixture built from the reported sequence:

spawn child C
C completes
close_agent(C) -> previous_status=completed
persist parent
restart app/server
open parent
=> C renders completed/history-only
=> C does not count toward active limits
=> no runtime/process is recreated for C

and the corruption twin:

historical spawn exists, terminal record missing, no live owner
=> stale/unknown + repair path, not active

The invariant is: task restoration may reconstruct history, but only current runtime evidence may reconstruct liveness.

Sythos · 17 days ago

Still issue alive in desktop app 26.803.5235.0 (win11pro fully updated)

workaroudn: select one by time, waiting the sync, go abck and the subagent go back "done"

Sythos · 14 days ago

Really, last update made things worst :D

<img width="302" height="70" alt="Image" src="https://github.com/user-attachments/assets/17a2cec1-4b0e-42be-be8a-95f658762c2e" />

pomazanbohdan · 5 days ago

This reopen-triggered rehydration also reproduced on Windows: children with terminal task_complete rollouts and no live handles returned to Active after the parent was opened again. Opening a child forced a one-by-one refresh; restart did not repair the projection. This links directly to #37042, #37563, and the stale-handle report in #23930.

maan56 · 2 days ago

Additional macOS reproduction observed on 2026-08-26:

  • Before restarting Codex Desktop, the Subagents panel showed Active 33 / Done 10.
  • Runtime inspection exposed no corresponding live workers for several displayed entries.
  • Direct interrupt attempts for displayed agents such as /root/fix_keyboard_navigation, /root/workbench_roving_focus, and /root/issue21_implementation_retry returned not_found.
  • After fully restarting the app and reopening the same task, the panel became Active 40 / Done 3.
  • Several agents previously shown under Done moved back to Active/Working, including Fix selector dynamic asset loading, Scope vehicle selector asset, and Invoice dropdown offset.
  • Their displayed elapsed timers continued increasing.
  • The underlying agents had previously returned completed/final results.

This strengthens the task-rehydration/state-reconciliation diagnosis: restart does not merely preserve stale classifications; it can reclassify additional completed agents as active and reduce the Done count. The UI therefore cannot be used to determine whether model usage or concurrency is still active.

Two cropped screenshots containing only the Subagents panel are available if maintainers need them.

pomazanbohdan · 2 days ago

Update (2026-08-26, Windows/MSIX): the load-time rehydration pattern is reproducible on Codex Desktop 26.820.7780.0 (x64) with bundled CLI codex-cli 0.150.0-alpha.8.

After completed child agents were cleaned/closed, the UI initially looked clear. After the app ran for some time and the affected parent chat was reopened, historical children reappeared as Active/Working. A read-only audit showed no live child handles, but 172 persisted child rows (171 normally completed, 1 incomplete), stale thread-history activity, 452 rollout ordinal gaps, and projection cursors that lagged far behind the corresponding rollout ends. The rollout JSONL files were still present, so this is not confirmed message deletion; the history materializer is failing to advance and task load rehydrates stale activity as active.

Reproduction: spawn children, let them complete, close/reopen Codex, wait for background materialization, then reopen the same long-running parent task and inspect Subagents. The stale rows return. This reproduces the lifecycle/state-projection divergence on current Windows. No private project data is attached.