[Windows App] Stale/orphaned subagents cause runaway session growth, thread errors, and archive failure

Open 💬 5 comments Opened Aug 15, 2026 by robertor-develop
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

26.810.41047

What subscription do you have?

ChatGPT Work

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What issue are you seeing?

Long-running Codex App coordination sessions that use subagents can accumulate stale/orphaned agent state and very large JSONL transcripts. The App then becomes slow and unstable, the Subagents panel continues to show agents as active for days, repeated thread not found errors appear, and the affected task cannot be archived.

Observed in two successive coordination tasks:

  • Task A transcript grew to approximately 1.20 GB.
  • Task B transcript grew to approximately 472 MB.
  • Task B's Subagents panel showed 2 agents still active for roughly 3 days and 54 completed agents.
  • The UI repeatedly displayed thread not found for the affected task.
  • Archiving the task failed with an App error.

No customer data, repository contents, prompts, or transcript attachments are included in this report.

What steps can reproduce the bug?

  1. In the Windows Codex App, use a long-running main coordination task.
  2. Spawn and complete multiple bounded subagent runs over time.
  3. Mix subagent activity with coordination/wait activity across a long session.
  4. Continue using the same task after completed agents accumulate in the Subagents panel.
  5. Observe that some agents can remain shown as active after their useful work has ended.
  6. Continue until the transcript becomes very large.
  7. Reopen or interact with the affected task and attempt to archive it.

Observed results:

  • Stale agents remain listed as Processing for days.
  • Agent-related records and waits continue accumulating in session history.
  • The App emits repeated thread not found errors.
  • The task becomes difficult or impossible to use normally.
  • Archive fails.
  • Overall Codex App responsiveness degrades.

Affected session identifiers (provided for maintainers to correlate diagnostics):

  • 019f5bdf-53b3-7fb3-ad75-9bee0194b844 (~1.20 GB transcript)
  • 019fc779-001b-70e2-a2c0-645e8e4899d5 (~472 MB transcript)

What is the expected behavior?

Completed or terminated subagents should leave no live/orphaned runtime state. The App should enforce a hard circuit breaker before agent count or transcript size becomes dangerous, keep task ownership inspectable, allow reliable cancellation, and always allow an affected task to be archived. A stale agent must not generate persistent waits, callbacks, or repeated thread lookup failures.

Additional information

This appears related to #23700 (Stale Codex subagents), but the Windows App impact here also includes extreme transcript growth, repeated thread not found errors, system-wide App degradation, and archive failure.

Requested safeguards:

  • Explicit subagent ownership by the initiating task
  • No recursive subagent spawning unless explicitly enabled
  • Configurable hard agent ceiling
  • Per-run authorization and bounded lifetime
  • Reliable cancellation and cleanup
  • Session-size and agent-count circuit breakers
  • Clear stale/orphaned state diagnostics
  • Archive repair that does not require reopening or resuming corrupted runtime state

I can provide privacy-reviewed diagnostic counts or sanitized evidence if a maintainer identifies the exact safe diagnostic format needed. -----NEW INFO ---- The exact miss is now clear: MAIN 02 used visible thread-control tools wrapped inside custom_tool_call: exec, not just spawn_agent. The old script removed internal-agent calls but left 299 thread-routing calls plus their outputs, 126 duplicated session headers marked thread_source: subagent, 39 compaction payloads, 252 world-state snapshots, 975 turn contexts, and 1,077 old thread-setting records. Those are what rebuild the garbage and preserve the nightmare instructions.

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 12 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #38408
  • #38364
  • #38577
  • #38478

Powered by Codex Action

shleder · 11 days ago

The persisted-history side of this is a useful field case for codex-rescue==0.1.0a4, especially the stale thread-routing/tool records and compaction/state snapshots you identified. It will not clean up live subagents, fix thread not found, or repair archive/runtime ownership, but a read-only doctor pass can independently classify the rollout structure and unfinished/schema/tool-state evidence.

If you still have an affected rollout that is safe to scan locally, I’d start with the smaller one rather than the ~1.20 GB file:

codex-rescue doctor --json "/path/to/the-affected-rollout.jsonl"

Please share only a sanitized summary of status, findings, and aggregate counts. Do not post the raw rollout/session DB, prompts, tool names/arguments/output, repository data, credentials, thread IDs, or private paths.

pomazanbohdan · 5 days ago

Additional Windows cluster evidence: stale/orphaned children, persisted Active/Working state, large rollout growth, and archive failures appeared together after long multi-agent sessions. The cluster separates live execution from persisted projection/residency (#37042 and #39694) and requires backup-first cleanup with post-restart parity checks.

LAVMendonca-labs · 4 days ago

Fresh Windows reproduction on Codex Desktop 26.818.5229.0:

  • The Subagents panel shows 11 historical children as Processing, with displayed ages of roughly 1 day to 9 days.
  • Local lifecycle evidence shows that 10 of those 11 children had already emitted at least one FINAL_ANSWER. One has no visible terminal result.
  • The current collaboration readback does not expose those historical children; attempting to interrupt one by its former canonical path returns not_found.
  • Despite that, the UI continues to render all 11 as active/processing.
  • App-level list_threads did not return after more than 45 seconds and had to be aborted. An individual read_thread attempt against one stale child also did not return after more than 30 seconds.
  • The affected rollout is currently about 58.14 MiB.

This looks like persisted UI/session projection diverging from authoritative runtime state, consistent with the issue description. No prompts, repository contents, private paths, credentials, or thread IDs are included here. A cropped Subagents-panel screenshot is available privately if maintainers need it.

shleder · 1 day ago

Fresh Windows reproduction confirmed on my install too, same signature: children long finished, registry empty, roster restored as Active. For evidence collection, comparing the Subagents panel against vetto rescue --json scan (pure rollout layer) documents the projection-vs-canonical gap cleanly.