Skip to content

feat: show running delegated tasks on the Coordinator (#2266) - #2277

Merged
chuks-qua merged 3 commits into
mainfrom
feat/delegated-task-running-signal
Oct 21, 2026
Merged

chuks-qua merged 3 commits into
mainfrom
feat/delegated-task-running-signal

Conversation

@chuks-qua

@chuks-qua chuks-qua commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Before this change, a Coordinator whose turn had ended looked idle even while a task it started with delegate_task was still running. The child thread is hidden from the sidebar, so nothing on screen said work was still going on.

Now the Coordinator's sidebar row shows the normal running mark while any of its delegated tasks is unfinished. The open conversation keeps its status line, reading "Waiting on subagents" with the layers icon. It shows no step count and no clock, because those belong to the turn that already ended. Both clear when the last task finishes, fails, or is stopped, and the status line fades out in the same shape.

 ThreadAttention (thread.attention, broadcast to every client)
   threadId, waiting, lastTurn, seen
+  hasUnfinishedDelegatedTasks   # derived on read, never stored
server
  DelegatedTaskStore.listUnfinishedCandidates   # SQL drops tasks with durable terminal evidence
  DelegatedTaskService.coordinatorsWithUnfinishedTasks
    deriveTaskState(turn, startup, approval, launching)   # same rule task_status uses
  invalidate Coordinator attention on
    roster change, launch start, settled child turn
web
  deriveThreadRowState
    needs-you  >  own running  >  plan ready  >  unseen Interrupted
      >  delegating -> running  >  unseen Failed/Finished  >  quiet
  narrativeIndicatorItem
    own turn idle + delegating -> "Waiting on subagents", no steps, no clock

Verified with the targeted suites (67 server tests, 225 web tests), the contracts, server, and web typechecks, lint, and live captures in Electron.

Why

Users hand long work to delegated tasks and then look away. If the Coordinator reads as idle, they can't tell whether the work is still going or forgotten without opening the task. Closes #2266.

UI Changes

Captured live in Electron. A Claude Coordinator delegates a two-minute shell task with delegate_task and ends its own turn.

Before (main) After
Before: the Coordinator row looks idle and no status line shows After: the row shows the running mark and the status line reads Waiting on subagents

When the task finishes, both clear:

After the task finishes: no running mark and no status line

Review Notes

  • Wire schema. ThreadAttentionSchema is strict, like every wire schema here. A web tab still running a pre-change bundle drops attention pushes until it reloads. The desktop app ships client and server together, so it is not affected.
  • Toast timing. The turn-end toast now waits until the last delegated task ends, because a running row defers toast accounting. This is deliberate. A task-finished toast is out of scope (feat: wake the Coordinator thread when a delegated task finishes #2217 wakes the Coordinator instead).
  • Stop button. The composer stop button still follows the Coordinator's own turn only. Stopping a delegated task stays in its chip.
  • Abandoned tasks. A task whose startup is left pending or blocked, or whose approval stays pending, keeps the Coordinator running. This matches what task_status reports for the same task.
  • No migration and no cache. The flag is derived on each attention read from one prefilter query joined on primary keys plus per-task lifecycle reads.
  • Documentation: none needed. The behavior follows the existing running indicators.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Thread attention now carries hasUnfinishedDelegatedTasks, derived on read
from each task's startup, approval, launch, and original turn. Roster
changes, the launching state, and settled child turns invalidate the
Coordinator's attention so every client hears when the flag flips.
A thread with unfinished delegated tasks reads as running once its own
turn ends. Anything that needs the user still wins, and the turn-end
toast waits until the last task finishes.
The open conversation keeps its status line after the Coordinator's turn
ends, reading Waiting on subagents without the ended turn's steps or clock,
and fades it in that shape when the last task finishes.
@chuks-qua
chuks-qua merged commit c18f248 into main Oct 21, 2026
14 checks passed
@chuks-qua
chuks-qua deleted the feat/delegated-task-running-signal branch October 21, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: show that a delegated task is still running after the Coordinator's turn ends

1 participant