Skip to content

[Bug]: A Claude subagent waiting on its own background command or Monitor shows as finished, and its commands aren't shown #27700

Open

Description

@guryanov-a

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. In a Claude Agent thread, have the agent launch a background subagent: Agent with run_in_background: true (here also isolation: "worktree").
  2. In the subagent, start a long shell command with Bash run_in_background: true (here a multi-minute cargo test run), arm a Monitor on it, and end the subagent's turn. The parent receives a task_notification (status completed) whose summary says the agent is "waiting on its own background work".
  3. While that command is still running, look at the parent thread.
  4. Send the subagent a message with SendMessage, which resumes it.

Timeline from one thread (native subagent id ae822370b88798e95, times UTC, approximate):

  • 14:47: the subagent is launched as above.
  • Over the next ~2 h it repeats step 2 several times; each time the parent gets a completed notification saying it waits on its own background work.
  • ~16:40: Lineage shows no running subagent and there is no "Running N commands" bar. On the machine, the subagent's cargo test and several rustc processes are running, and its log file was written seconds earlier.
  • ~16:46: the parent sends SendMessage. Lineage immediately lists the subagent as running, and the bar shows "Running 1 command and 1 monitor" with its new command.

Expected behavior

While a subagent has its own background commands or monitors alive, it stays shown as running (or as waiting on background work), and those commands and monitors are visible in the subagent row or in the parent's command bar.

Actual behavior

Between its turns, the subagent drops out of Lineage's running list and its background command and monitor are not shown anywhere. A subagent doing real work can't be told apart from a stalled thread with nothing running.

Impact

Minor bug or occasional failure

Version or commit

T3 Code (Beta) 0.1.5

Environment

macOS 27.0.1, desktop app, Claude Code 2.1.314, Claude Agent provider, parent claude-opus-5-5, subagent claude-haiku-5-5

Logs or stack traces

No response

Screenshots, recordings, or supporting files

No response

Workaround

Check the subagent's log files or processes on disk, or send it a message to resume it, which makes it visible again. Related: #18966 and #17625 (the same problem for whole threads, both closed), #24337 (the reverse for Claude background subagents: stuck as Running after finishing).

Activity

  1. guryanov-a commented on Oct 31, 2026

    @guryanov-a
    Author

    Two more observations from a second thread (same setup: Claude Agent parent, background Haiku subagent in a worktree, T3 Code 0.1.5, times UTC):

    1. The command bar sometimes does show the subagent's command between its turns.

    • 05:19: the parent launches a fresh background subagent (no SendMessage resume involved).
    • 05:29 and 05:30: the parent receives two completed notifications for it. Its last message says its second scripts/check.sh run is going and a monitor will report when it finishes.
    • 05:30 to 05:35+: the thread's bar shows "Running 1 command and 1 monitor" with that subagent's command. On the machine, the subagent's check.sh / cargo test --workspace is running in its worktree.

    So the "not shown anywhere" case in the report above isn't consistent. In the original case the command appeared only after the parent resumed the subagent with SendMessage. Here it was the first run of a freshly launched subagent. I don't know which condition decides it.

    2. The thread status says completed while the bar shows running work.

    During the same window, the thread record has status: completed and activeRunId: null (the latest run completed at 05:30:10), and the thread list shows it as done, while the thread's own bar shows "Running 1 command and 1 monitor". This looks like a regression of #18966 / #17625, or their fix doesn't count background work owned by a subagent.

    Expected: while any command or monitor in the thread (including a subagent's) is alive, the thread is shown as working, consistent with the bar.

  2. guryanov-a commented on Oct 31, 2026

    @guryanov-a
    Author

    Upstream part: Claude Code sends <status>completed</status> for a subagent that has only stopped while its own background command or Monitor is still running, even though the same notification's summary says it "is waiting on its own background work". Reported at anthropics/claude-code#92952 (details for 2.1.300: anthropics/claude-code#92952 (comment)).

    Until that's fixed, T3 could treat a notification whose <note> says the result "may be interim" as still running, rather than relying on status.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions