Skip to content

Show what a thread is waiting on when it hands work off (#42) - #62

Merged
currentbits merged 1 commit into
mainfrom
coder/no-status-when-an-agent-is-waiting-on-wo-5a74f7
Aug 15, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/no-status-when-an-agent-is-waiting-on-wo-5a74f7

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #42.

Why

When a thread delegates — thread_fork / thread_send workers via the coder-threads MCP server, or in-agent Agent-tool subagents — it ends its own turn, so its status reads idle/done/working like any other thread. Nothing said it was blocked on delegated work, which thread(s), for how long, or that a child had stalled. From the outside a healthy wait and a hung fan-out looked identical, which is the shared root behind #31, #32 and #34.

What changed

src/waiting.ts derives the wait in one pass over the thread rows, from state that already exists (handoffFrom plus the runner's subagents rows) — no new state, no new IPC. Only live children count: a worker still running, or one stalled on a permission prompt.

Rendered in both places the user looks:

  • Sidebar card — a Waiting on 2 workers · 3m row under the branch/status line with a pulsing dot, amber when a child is blocked on a prompt, hover tooltip naming each child. It sits on its own row rather than as a chip beside the status badge: on a narrow card the branch + PR chip squeezed it down to Waiting on…, losing the count that is the whole point.
  • Agents panel — the same line above the Team roster (which already lists child name, status, and last assistant line, with click-through), and a worker stalled on a permission prompt now reads waiting instead of working, so a stuck fan-out is obvious without opening every worker.

threads:summaries now carries runStartedAt and awaitingInput so the panel can show elapsed time and flag a blocked worker. formatWorkingLabel was split so the elapsed formatter is shared.

Not covered

A worker stopped mid-run is indistinguishable from a fork that never ran (both idle, runStartedAt cleared) — marked with a ponytail: comment; it needs a stopped flag on the thread. Failed children do not count toward the badge (their own card is already red and the Team roster lists them), and the slim pinned/settled rows carry no badge.

Verification

  • npm test — core 38/38, renderer 752/752, electron 727/727, memory-server 119/119

  • npm run typecheck clean

  • New tests: test/waiting.test.ts (helper), plus sidebar-badge and Agents-panel cases in test/sidebar.test.tsx / test/teamView.test.tsx

  • Looked at it in the running app: forked a thread in the mock UI, started its run, and captured the sidebar row and the Team wait line mid-run

  • PR created by the Claude Code agent

A thread that hands work off — thread_fork/thread_send workers or in-agent
subagents — ends its own turn, so its status reads idle/done like any other
thread and a hung fan-out looks exactly like a healthy one.

Derive the wait from state that already exists (handoffFrom + the runner's
subagent rows) and render it in both places the user looks:

- sidebar card: a "Waiting on 2 workers · 3m" row under the meta line, amber
  when a child is stalled on a permission prompt, hover lists the children
- Agents panel: the same line above the Team roster, and a worker blocked on
  a prompt now reads "waiting" instead of "working"

threads:summaries carries runStartedAt + awaitingInput so the panel can show
elapsed and flag a blocked worker.

Co-Authored-By: Claude Opus 5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit 4c71015 into main Aug 15, 2026
1 check passed
@currentbits
currentbits deleted the coder/no-status-when-an-agent-is-waiting-on-wo-5a74f7 branch October 3, 2026 16:07
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.

No status when an agent is waiting on work it handed off

1 participant