[Bug]: A Claude subagent waiting on its own background command or Monitor shows as finished, and its commands aren't shown #27700
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#
- In a Claude Agent thread, have the agent launch a background subagent:
Agentwithrun_in_background: true(here alsoisolation: "worktree"). - In the subagent, start a long shell command with
Bashrun_in_background: true(here a multi-minutecargo testrun), arm aMonitoron it, and end the subagent's turn. The parent receives atask_notification(statuscompleted) whose summary says the agent is "waiting on its own background work". - While that command is still running, look at the parent thread.
- 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
completednotification 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 testand severalrustcprocesses 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).
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: https://github.com/anthropics/claude-code/issues/92952#issuecomment-6542239388).Until that's fixed, T3 could treat a notification whose
<note>says the result "may be interim" as still running, rather than relying onstatus.tanstack-source added labelsbug
The same thing happens with child threads started by
delegate_task(not only nativeAgentsubagents), on T3 Code v0.1.10, Linux, Claude Code 2.1.329, Claude Agent provider,claude-opus-5-5for parent and child.Steps:
- A parent thread starts a child with
delegate_task(isolation: "worktree"). - The child starts a long script with
Bashrun_in_background: true(a build plus a test run, about 30 min) and ends its turn without callingt3_background_wait. - While the script runs, look at the child thread in the UI and read it with
t3_thread_read.
What I see:
- The UI shows the child as finished, with nothing running.
t3_thread_readon the child returnsstatus: "completed",activeRunId: null, andpendingBackgroundTaskswith the script still in it (kind: "command").- On the machine, the script and its test processes are running and writing their logs.
- When the script exits, the child gets a new turn and carries on. Across one morning, one child went through 21 short turns this way, and the UI showed it idle between them each time.
From #36609, I understand that a command the agent did not await is not supposed to hold completion, so
completedmay be intended. The problem is the UI. T3 already has the live command inpendingBackgroundTasks, but nothing in the UI shows it. So a child that is doing real work looks the same as one that has finished, and the user had to ask the parent whether the child was stuck.Expected: while
pendingBackgroundTasksis not empty, the child shows as running or as waiting on background work, or at least shows its command, even when the command was not awaited.- A parent thread starts a child with
Same here on T3 Code (Beta) 0.1.9, with the iPad app as the client. It matches the second observation in this earlier comment: the thread reads as finished while its own bar shows running work.
Setup: the desktop app on macOS 27.2 is the server, Claude Agent provider (Claude Code CLI 2.1.323 installed), parent on
claude-fable-5-2, and a native backgroundAgentsubagent onclaude-opus-5-5that the parent resumes withSendMessage.Timeline (UTC, 26 Nov):
- 02:52:18: the parent resumes the subagent with
SendMessage. At 02:52:32 the parent gets a "Subagent ... finished" notification and runs a 3 second turn. - 03:06:58: the subagent resumes, starts a long test run in the background, arms a
Monitoron its log, replies "Waiting." and ends its turn. The parent gets "Subagent ... finished" again, and its run completes at 03:07:01. - 03:15 (screenshots): the test run is still going on the machine. Its log finished at 03:18.
- 03:21:
t3_thread_readon the parent returnsstatus: completed,activeRunId: null, and no run since 03:07:01. The subagent thread isidle. - By 03:24 the subagent had resumed on its own and the parent had started its next run.
What the client showed at 03:15:
- Thread list: the row shows only its age ("8m"), with no working state. Other rows in the same list show their Done and Woke badges.
- Timeline: two "Subagent ... finished" rows for the subagent that owns the running work.
- Bar: "Running 1 command and 1 monitor", Stop, and "1 done" in the agent count.
- Background work sheet: the Command and the Monitor. The Monitor is the one the subagent armed in its last turn.
So for about 16 minutes the thread list and the subagent rows said the work was over, and only the bar inside the open thread showed that it was not. From the list there was no way to tell this thread from an idle one.
Expected, as in the report: while a subagent's command or monitor is alive, the subagent is not reported as finished, and the thread shows as working (or waiting on background work) in the thread list.
Thread titles, message text and command names are redacted.


- 02:52:18: the parent resumes the subagent with
Sign in to join this conversation.
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.
SendMessageresume involved).completednotifications for it. Its last message says its secondscripts/check.shrun is going and a monitor will report when it finishes.check.sh/cargo test --workspaceis 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: completedandactiveRunId: 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.