Codex desktop rehydrates closed, terminal subagents as Working after restart
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with the Subagents panel rehydration path and the persisted thread_spawn_edges state. Run the provided sqlite3 query and inspect how task_complete, turn_aborted, and closed records are handled during restart. Done means terminal historical children remain completed or aborted and are not shown as Working after rehydration.
Written by the indexing model from the issue text.
Description
Summary
Codex desktop 26.803.41515 (build 6321, Chromium 151.0.7922.76) incorrectly rehydrates completed and aborted subagents as Working after application startup.
The affected sessions are not live. Every inspected child rollout has a terminal event, every persisted spawn edge is closed, and backend lookup returns not_found. The Subagents panel nevertheless reconstructs historical children as active, including elapsed times of several days.
Impact
- False active-agent counts across affected parent conversations.
- Users cannot determine whether background work actually exists.
- Completed agents appear to be running for days.
- The panel may introduce UI/session-loading overhead when many historical children are reconstructed.
Evidence
- Historical child sessions inspected: 516
- Parent conversations affected: 11
- Terminal rollout events:
task_complete: 469turn_aborted: 47- Missing terminal events: 0
- Persisted
thread_spawn_edgesstate:closed: 516open: 0
- SQLite integrity check:
ok - Backend lookup of affected historical agents:
not_found - One affected conversation (“Oanda”): 76 recorded subagents; all 76 end with
task_complete; the UI still shows them as working.
Reproduction
- Use a conversation that previously spawned many subagents and let them complete or abort.
- Open the Subagents panel. Completed children may be shown as Working, with long elapsed times.
- Quit and restart Codex desktop.
- Reopen the same conversation.
- The same terminal historical children are rehydrated as active.
- Compare persisted edge state:
sqlite3 ~/.codex/state_5.sqlite \
"SELECT status, COUNT(*) FROM thread_spawn_edges GROUP BY status;"
Expected result for the affected data: all records are closed. The UI still reports the agents as working.
Expected behaviour
On rehydration, the Subagents panel should honour terminal child rollout events (task_complete / turn_aborted) and the persisted thread_spawn_edges.status = closed state. Historical child-session existence alone must not imply a live working agent.
Actual behaviour
The desktop UI appears to infer Working from a historical subagent session or spawn record, ignoring terminal and closed state.
Additional observation
Resuming one representative stale child and explicitly closing it produced a shutdown notification. This suggests the live UI understands an explicit shutdown transition but fails to recognise already-terminal historical sessions during startup.
Scope and safety
This report is diagnostic only. No project files, databases, caches, conversations, or project artefacts were changed during investigation.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·