Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Background-work banner counts the workflow coordinator as a working agent #5807

Closedartieeg(GitHub profile, opens in a new tab) opened this issue 0 comments

Before submitting

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

Area

apps/web

Steps to reproduce

  1. Open a thread and run any workflow that spawns members (e.g. Workflow with 2 phases, one agent each).
  2. Let the first member finish while the second is still running.
  3. Look at the three places the app reports agent counts:
    • inline spawn card in the transcript
    • Agents right panel
    • background-work banner above the composer

Deterministic repro without a provider (client-side fold only):

  • Seed projection_thread_activities with a local_workflow coordinator (task.started, taskType: "local_workflow", agentKind: "agent") plus two members carrying parentAgentId, one task.completed and one left running.
  • Unit repro: deriveAgentPanelModel with that roster returns liveCount: 2.

Expected behavior

All three surfaces agree on the number of agents actually working. With one member running and one settled, the banner should read "1 agent working in the background" and the panel footer "1 working · 1 settled".

Actual behavior

The banner reads "2 agents working in the background" and the Agents panel footer reads "2 working · 1 settled", while the inline card correctly reads "Spine · 1 working".

Root cause: deriveAgentPanelModel in packages/client-runtime/src/state/subagentRuntime.ts tallies status buckets over every entry in source, which includes the workflow coordinator (kind === "workflow"). The coordinator stays running for the whole run, so liveCount = runningCount + waitingCount is one higher than the number of agents doing work.

The inline card (apps/web/src/components/chat/MessagesTimeline.tsx, AgentSpawnCtaRow) builds its list from workflowGroup.phases.flatMap(members) — coordinator excluded — which is why it is the only correct one.

Second site with the same cause: apps/web/src/components/AgentsPanel.tsx renders ● {runningCount + waitingCount} working in the footer.

Note the same function already applies a coordinator-exclusion rule for totalTokens a few lines below (if (agent.kind !== "workflow" || members.length === 0)); it was never applied to the status counts.

Scale: with N concurrent workflows the banner is off by N. A workflow whose members have all settled between phases reads "1 agent working" when zero are.

Impact

Cosmetic issue

Version or commit

main @ a20923ce4

Environment

macOS 15 (Darwin 22.6.0), Chromium 1161, Node 24.16.0, T3 Code web dev server

Logs or stack traces

Screenshots, recordings, or supporting files

Image

Workaround

None. The inline spawn card and the per-phase counts in the Agents panel are correct; only the composer banner and the panel footer overcount.

  1. artieeg(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. juliusmarminge closed this

Sign in to join this conversation.