Skip to content

Subagent rows can remain running for days after semantic text says subagents are done #341

Closed

Description

@Juliusolsson05

Problem

Subagent UI can show old agents as still running long after the semantic/live text reports completion.

Related: #178.

Evidence

Bundle 2026-06-21T20-14-23-131-62432945:

  • Note complains that subagent UI is poor/regressed.
  • state-snapshot.json: 73 subagents, 57 still running; some lastActivityAt values are from June 18.
  • proxy-semantic.json: text says "All 7 subagents done".

Bundle 2026-06-22T09-05-45-698-7733b0fc:

  • 79 subagents, 77 still running, with stale activity timestamps.

Suspected Cause

Codex status derivation is too narrow. Status appears to flip to terminal only when:

  • a <subagent_notification> reports completed/failed, or
  • child entries contain event_msg task_complete.

There is no stale/terminal inference from parent wait text, child session exit, lack of activity, or parent wait_agent completion semantics.

Relevant paths:

  • src/main/subagents/codexSubagentState.ts
  • src/renderer/src/features/feed/ui/rows/TaskSubagentRow.tsx

Expected

Completed/waited Codex subagents should transition to done/error reliably. Old inactive child sessions should not remain visually running forever, and debug diagnostics should summarize subagent status counts and stale-running candidates.

Activity

  1. Juliusolsson05 commented on Jun 22, 2026

    @Juliusolsson05
    OwnerAuthor

    Linking this to #172 and #178 with an important boundary: stale-running status is a lifecycle/state derivation bug, so the new rendering engine will not fully solve it by itself.

    The #172/#178 work should still consume the final subagent lifecycle state as typed feed items and make status ownership/debug output clear. After #172 lands, this should be re-tested to separate state bugs from display bugs.

  2. added a commit that references this issue on Jul 7, 2026
  3. Juliusolsson05 commented on Jul 7, 2026

    @Juliusolsson05
    OwnerAuthor

    Fixed by #459 (wait_agent fan-in terminal inference for MCP children + stale status after ~5 quiet minutes so a subagent is never an eternal spinner + terminal pruning after ~10m) and #488 finding-16 (tombstone pruned agents so a completed child's transcript isn't re-tailed as "running" every poll). The stuck "57 of 73 still running for days" case is addressed. Closing.

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

    bugSomething isn't workingprovider:codexAffects Codex integration

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions