Codex app subagent cards can remain stuck/visible after close while close/readback reports no live agent
Summary
In the Codex app, completed or closed subagents can appear to remain visible/stuck in the UI for a long time even after the supported close/readback path reports that there is no live agent handle left.
Component
Codex app / Desktop on macOS.
I do not know the exact app version from the UI at the time of filing.
What happened
A workflow used several subagents for bounded helper work. After the helpers completed, attempts to close them by exact returned agent IDs produced a mix of:
- a completed previous status,
- a running or pending previous status followed by successful disappearance from readback,
- or not_found for handles that were already gone from the live route.
Even after those close/readback results, the app UI could still make it look like subagents were present or stuck. In one child/subagent view, the UI showed a banner asking the parent to resume the sub-agent to continue the conversation, which suggests the child was closed, but the surrounding UI state still made it unclear whether a subagent was active, closed, or stale.
Expected behavior
After a subagent completes and is closed, the Codex app should make the lifecycle state unambiguous:
- closed/completed subagent cards should update or disappear from active/open UI surfaces,
- stale IDs should be shown as already closed rather than appearing stuck,
- the parent thread should have a clear way to see that no live subagent remains,
- and not_found after close/readback should not leave the user thinking an agent is still running or consuming an active slot.
Actual behavior
The live close/readback route can indicate that no live handle remains, while the UI still appears to show stale/open subagent state or a closed-child resume banner. This makes it hard to tell whether work is still running, whether slots are still occupied, or whether the UI is stale.
Impact
This is confusing during long-running work and makes it difficult to trust whether background/subagent work has actually stopped. It can lead to repeated close attempts and uncertainty about whether resources or subagent slots are still in use.
Request
Please clarify or fix the Codex app subagent lifecycle UI so the app reliably reflects completed/closed/stale states after subagent close/readback, especially when close returns not_found for an already-gone handle or when a child thread shows the parent-resume banner.
29 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks. I reviewed the duplicate candidates from the bot.
This looks closest to #23700 and #23219, but I am leaving this issue open because it narrows the symptom to Codex Desktop/app UI lifecycle state: the live close/readback path no longer exposes a running subagent handle, while the app can still show stale/resumable subagent cards or stale open rows. #22744 and #23292 also look related on subagent status/rendering or parent-thread waiting behavior.
If maintainers prefer this tracked under #23700 instead, I can close this as a duplicate.
Additional datapoint from another current Desktop session:
This makes the issue look less like a live subagent leak and more like a Desktop UI/cache/state propagation problem: closed or already-gone subagents remain rendered as if attached/active in the thread side panel. I am not attaching the screenshot because it includes workspace/thread details, but the visible UI symptom was the Subagents section still listing entries such as Rawls/Linnaeus/Kuhn/Ptolemy and “Show 67 more” after the lifecycle state was terminal.
Additional public cross-link/update after checking the related stale UI / active-turn chain:
I am keeping this issue open because the specific symptom here remains stale subagent UI/lifecycle rendering after close/readback shows no live agent. #24287 strengthens the adjacent Desktop state-desync signal, but it does not replace this exact subagent-card lifecycle report unless maintainers prefer a different canonical issue.
Additional datapoint from today:
This matches the stale subagent lifecycle/UI symptom tracked here: the user-facing panel can keep showing a subagent after the parent-side lifecycle action has already been taken.
Additional datapoint from another current Codex Desktop session:
The Subagents panel showed multiple final-pass subagents still listed, including Pauli (final_synthesis_gate), Fermat (final_word_packet_auditor), final_counteruse_confidentiality_auditor, final_authority_source_force_auditor, final_service_procedure_auditor, and Banach (final_fact_pin_auditor).
This is the same stale subagent lifecycle/UI symptom: completed or closed helper agents remain visible in the Desktop Subagents panel, making it unclear which agents are still active versus stale UI entries.
Additional datapoint from another current Codex Desktop session:
The Subagents panel showed a long list of final-pass subagents still visible, including Mill (final_synthesis_gate), Sartre (final_word_packet_auditor), Kuhn (final_fact_pin_auditor), Bernoulli (final_synthesis_gate), Euler (final_word_packet_auditor), Faraday (final_fact_pin_auditor), and truncated unnamed role entries for final_counteruse_confidentiality_auditor, final_authority_source_force_auditor, and final_service_procedure_auditor.
The panel also showed Show less, which means the stale/visible subagent list had expanded beyond the first visible group. This is another example of completed or stale helper agents remaining visible in the Desktop Subagents panel, making active versus stale state unclear.
Additional root-cause clue from local state inspection:
This supports the theory that the Desktop panel can render from persisted spawn-edge state that may not be reconciled when a child is already gone from the live close route.
Additional confirmed datapoint after local repair and multiple app restarts:
The local Codex state database now shows all subagent spawn edges as closed:
Despite that, after restarting Codex Desktop multiple times, the Subagents panel still visually shows stale subagent cards.
This makes the remaining symptom look like Desktop UI/cache/rendering state surviving restart even when persisted lifecycle state reports no open edges, rather than an active subagent/lifecycle leak.
I added a small evidence packer for this subagent lifecycle/state-reconciliation class in
trace-to-skill@0.1.66:Not a fix, just a report-shaping helper. It tries to make future reports include Codex version, OS/surface, model/workspace, root thread id, subagent ids/nicknames/roles, spawn/close/list actions,
close_agentresults,list_agentsor/agentsoutput,thread_spawn_edgesstatus counts, registry/max_threads/quota evidence, recent-list/sidebar behavior, child archive/top-level state, last-progress/halt reason, MCP state, compaction/resume timing, restart/reload behavior, and whether stale agents are UI-only or still block spawns.Release: https://github.com/grnbtqdbyx-create/trace-to-skill/releases/tag/v0.1.66
Adding a root cause from the source, since this reproduces deterministically across an app restart and the mechanism looks like a listing-filter gap rather than a problem with close_agent itself.
Repro
In state_N.sqlite after step 2 the child row is thread_spawn_edges.status = 'closed' but threads.archived = 0. Setting threads.archived = 1 for that exact child id by hand makes it stay gone across a restart, which points at where the listing reads.
Root cause, as I read it
On the fix direction
archived looks like the user-facing archive action (mark_archived / mark_unarchived, ThreadArchivedNotification, and the archive RPC cascades to subagent descendants), distinct from the subagent lifecycle that thread_spawn_edges.status tracks. So having close_agent set archived = 1 would make a lifecycle event perform a user archive and pull the thread out of history and search. Filtering the subagent listing on the spawn-edge status instead keeps the two separate, which also lines up with the direction in #25112. #25341 captures the same data-side mismatch.
Happy to help however is useful.
Environment: Codex Desktop on macOS, version 26.601.21317 (released Jun 3, 2026).
Seen same issue. Feedback: 019f04ff-b2ce-7302-be1a-b511e0ee7cc1
Additional CLI/TUI evidence for the stale subagent lifecycle state:
v0.146.1, PowerShell, Multi-agent V2./agentsreportsNo sub-agents running, but the picker still lists two gray,anonymous
Agententries for closed/sidethreads.transcript.
The composer still accepts a follow-up and displaysQueuedfollow-up inputs`, but the input remains pending because there is no live agent
loop to consume it.
followup_taskreturnsagent with id ... not foundfor both. Local history/log/state inspectionconfirms these are ephemeral replay artifacts, not persisted child agents
available for native resume.
This narrows the CLI/TUI failure to a replay/liveness boundary: a historical
closed entry is still presented as a dispatchable agent. Could closed replay
entries be placed in a clearly separate read-only history surface, or have the
composer disabled when the selected thread is closed, so queued input can never
appear dispatchable without a live agent loop?
Additional Windows evidence with a deterministic 1:1 mapping between the Desktop panel population and historical subagent rollouts.
Environment
26.803.5235.00.147.0Results
| Case | Desktop Subagents panel | Historical descendant rollouts | Terminal rollout endings | Live registry after observation | Goal |
|---|---:|---:|---:|---:|---:|
| A | 49 working + 49 done | 98 direct | 91
task_complete+ 7turn_aborted| 0 live subagents;list_agentsreturned only/root| null || B | 51 working | 51 direct | 46
task_complete+ 5turn_aborted| 0 live subagents;list_agentsreturned only/root| null || C | 95 working + 18 done | 113 total (111 direct + 2 nested) | 105
task_complete+ 8turn_aborted| 0 live subagents;list_agentsreturned only/root| null |In every case, the panel's total card count exactly equals the complete historical descendant rollout population, while every rollout has a terminal ending and the live registry reports no live child.
The working/done split does not correspond to the terminal markers:
The last subagent spawns were on Aug 2, Aug 3, and Aug 4 respectively. The current Desktop process was started on Aug 8, so these cards survived a full app restart. Case A's parent had not performed new work after that restart before the stale cards were observed. Opening the affected parents produced ordinary thread read/resume activity and no new subagent spawn.
This strongly suggests that the panel rebuild is enumerating the historical child population correctly but is not reconciling terminal rollout state and/or durable child lifecycle state before assigning working/done labels. Goals are not required for the bug: all three cases have
goal: null.This independently supports the listing/rebuild explanation in the existing root-cause comment and the data-side mismatch in #25341. #26662 is merged and provides parent-filtered thread listing, but the current Desktop build still renders the complete historical population with incorrect lifecycle labels.
A separate fourth-thread observation may belong to #19197 rather than this UI-only bug: two exact agent IDs that had previously been successfully closed from
runninglater returned aspending_init, with no intervening spawn or resume in the parent rollout. That anomaly is not needed to explain the three cases above.Full thread IDs and screenshots can be provided privately if maintainers need them.
Codex Windows desktop "Codex & OWL Version 26.803.41515" the problem with subagents are still there. It's not possible to understand when an agent finish his task because the UI reports subagents active and in execution.
Reproduced on Windows with a current Codex desktop build.
Environment:
Observed:
completed.previous_status: completed.Expected:
The active/working count should be derived from live running states. Completed agents should stop contributing to the “working” count, and a full app restart should reconcile the UI with backend state.
This looks like the Windows manifestation of the UI/backend lifecycle drift described in this issue. No child agents are actually running according to the backend, but the visible status remains active.
@codex no plans to fix this?
@codex same here , please fix. Please add display of model selection and settings for sub-agents in the UI panel as well
@codex I did a read-only inspection of a current affected installation, and the key ambiguity appears to be that “working” is being used for persisted or retained subagents, not only for subagents that are currently executing.
Current data
Environment: Codex Desktop
26.803.61601, bundled CLI0.147.0-alpha.6.5, observed on 2026-08-13. No local state was modified.At the same moment:
thread_spawn_edgescontained 920 open edgesThis suggests that the panel count is based on retained historical relationships. It does not represent active execution or zombie processes.
The product ambiguity
Multi-agent V2 intentionally keeps agents available for follow-up work. That is useful, but “available for reuse” and “currently running” are different states.
When both states are shown as working, users cannot tell:
A small, compatible fix
A first fix does not need to redesign the lifecycle or migrate existing rows:
open/closedpersistence so follow-up and history behavior remain compatible.This would let the panel answer the practical question: “What is running right now?” It also avoids a risky cleanup or migration of old state.
Because external PRs require an explicit maintainer invitation, I have not prepared a PR. If this direction matches the intended semantics, I would be happy to submit a focused, test-covered change. Could a maintainer confirm the intended source of truth for the working count and invite the contribution?
Everyone please also send /feedback in the app, open cass with support chat bubble to document all this everywher because its unacceptable lot of bugs without fix for months.
<img width="1524" height="478" alt="Codex Desktop subagent panel showing stale Processing states for about 19 days" src="https://github.com/user-attachments/assets/42ce3fdf-faa7-46b5-ba77-271dd6a424c9" />
Confirming the stale subagent state on the current Windows build.
Environment
26.810.6296.0262000.148.0-alpha.9Visible symptom
The screenshot shows:
These agents had already finished, but the UI continued to present them as actively processing.
Read-only local-state check
No database or session files were modified.
Across the local profile:
thread_spawn_edges: 40 rowsstatus = 'open'archived = 0task_complete, 3turn_abortedThe screenshot is from one affected task, while the 40-row check is the aggregate across the local profile, so those two counts are not expected to match exactly.
This confirms that, on this installation, Processing does not represent current execution. The durable child/spawn state remains open after the rollout has reached a terminal state, and the Desktop UI appears to render or count that stale state as active work.
Expected behavior
In-app feedback
Submitted through the Desktop app's feedback flow.
019f9dc8-4f95-7143-b711-e1bcd8beb593The mismatch between live close/readback state and stale subagent UI state is useful as a lifecycle control case for
codex-rescue. I’m field-testing whether it can inspect the persisted parent/child sessions and avoid inventing an unfinished action merely because the Desktop UI still shows a stale agent card.If you still have one affected local workflow, could you run:
A healthy/no-damage result is useful too. Rescue does not fix the Desktop subagent card UI; it checks durable local evidence and keeps source rollouts read-only.
Please share only sanitized output, versions and exit codes—no raw rollouts/SQLite, prompts, agent IDs, credentials, or private paths. Repo: https://github.com/shleder/codex-rescue
A sub-agent finishes and returns its result, but the Subagents panel continues showing it as “Working.” The panel should immediately change to “Completed” or “Stopped” so I can tell whether anything is genuinely still running. This appears related to openai/codex issue #23930.
Adding another current Windows datapoint (2026-08-17):
26.810.7004.026200Expected: Working should be derived only from live non-terminal agent turns; retained, completed, or interrupted agents should be shown as inactive/history.
A screenshot was captured showing 28 working / 4 done; it contains no workspace content. This matches the visual evidence already attached in the previous Windows 26.810 datapoint.
No fix soon for this old bug/behavior since day 1 of codex? @etraut-openai @chess-oai @jif-oai @tibo-openai @dylan-hurd-oai
Additional Linux datapoint observed on 2026-08-19.
Environment
7.0.0-29-generic, x86_640.146.1Observed behavior
agent ... not found, consistent with there being no live agent process to close.thread_spawn_edges.statusvalues were allclosed.This is a useful control case because the visible cards are not merely old
openedges: the exact visible children are already persisted asclosed, yet the UI still labels them as working. It appears that the panel's working label is being rehydrated from stale child/thread presentation state rather than derived from a live non-terminal turn or the durable spawn-edge lifecycle state.Expected behavior
A cropped screenshot showing only the Subagents panel is available if maintainers need it. Thread IDs, local paths, and workspace details are intentionally omitted.
After checking the current Subagents lifecycle docs and current
openai/codexbehavior, I want to tighten the hypothesis here: completion is not the same as explicit close. Retained/completed agents may legitimately remain available for follow-up, so the bug is not simply that every terminal rollout must close its spawn edge.The newer control cases isolate the actual problem more cleanly:
closed, yet 5/6 visible cards still said is working.thread_spawn_edgeswasclosed=549, open=0and after multiple full app restarts.Together this points to a presentation/liveness-classification defect rather than a live-agent leak: historical/retained/closed children can be projected as
Working/Processingeven when no live non-terminal turn exists.A lifecycle invariant consistent with the documented model would be:
Working/ProcessingDone/Idle/AvailableThat framing preserves intended retention/follow-up semantics without making completion equivalent to close or archive.
Additional macOS reproduction: 17 completed children rehydrated as active after restart
Environment:
Observed sequence:
Runtime cross-check performed while the Desktop UI showed the stale population:
No private thread or agent identifiers are included here.
This appears to isolate a restart/hydration defect rather than a live-agent leak: the parent view rehydrates historical descendants as active, then reconciles terminal state lazily only when each child is opened. It is consistent with the historical-state behavior reported in #37222.
Expected behavior:
This matches a Windows variant: thread/read and the live registry reported terminal or missing child handles, while reopening the parent restored the cards as Active until each child was opened. That lazy per-child reconciliation is the presentation half of #37042 and #37916, not proof of live work.