Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client-runtime): count workflows between phases #8749

Closedyashranaway(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/8749/headopened View on GitHub

What Changed

  • Count a live workflow coordinator when all current phase members have settled.
  • Keep workflow coordinator token usage excluded when members exist.
  • Add coverage for the gap between workflow phases.

Why

A workflow remains active while its coordinator prepares the next phase, but the shared rollup reported zero live agents during that gap.

Closes #8720

Testing

  • pnpm exec vp test run packages/client-runtime/src/state/subagentRuntime.test.ts
  • pnpm exec vp run --filter @t3tools/client-runtime typecheck
  • pnpm exec vp lint packages/client-runtime/src/state/subagentRuntime.ts packages/client-runtime/src/state/subagentRuntime.test.ts

Checklist

  • One focused behavior change
  • Focused regression coverage
  • Formatting and lint pass

Model: GPT-5.6 Sol Harness: Codex in T3 Code


Note

Low Risk Localized change to agent panel counting in client-runtime; callers of deriveAgentPanelModel may see different live/running counts during workflow phase transitions.

Overview Fixes the agent panel rollup so a workflow coordinator is counted as live when the current phase’s members are all settled but the workflow is still active (gap before the next phase). Previously, coordinators with members were always omitted from runningCount / liveCount, so the UI could show zero working agents while the coordinator was still running.

deriveAgentPanelModel now treats a coordinator as standing in for its members (and skips it in status buckets) only when members still need representation—not when the coordinator is active and every member is terminal. Token totals still exclude workflow rows that have members to avoid double-counting aggregated usage.

Regression tests cover the between-phases case and confirm the coordinator stays hidden when a phase member is idle.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 770f5396e05d3c40d9b33866e025b5e976427181. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Fix deriveAgentPanelModel to count workflow coordinators between phases

  • Workflow coordinators with members are now counted as running/live when active and all members are terminal (e.g. between phases), and excluded when any member is non-terminal
  • totalTokens now excludes workflow coordinator usage whenever it has members, preventing double-counting; coordinators with no members still contribute their own usage
  • Adds tests in deriveAgentPanelModel suite asserting counting invariants for coordinators between phases and when members are idle
  • Behavioral Change: runningCount, idleCount, settledCount, and liveCount in subagentRuntime.ts change semantics for coordinators with members; verify consumers of these tallies handle the between-phase inclusion
Macroscope summarized 770f539.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: c29483f9-6a9d-465b-9786-f223ba8856d8

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Warning

      Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 38efa7cbb8fe406c6eacb6e69c3c1af67aa1f9a4. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 770f539

      Macroscope's review found this PR approvable — This is a small, localized client-runtime bug fix that corrects workflow liveness counts between phases while preserving member accounting and token totals. Targeted tests cover both the corrected case and the idle-member case, with no product-default or sensitive-area changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Verified locally on pr-8749 (770f539) as CDVolvik — no push.

      Checked out fix/workflow-phase-gap-live-count and inspected deriveAgentPanelModel in subagentRuntime.ts:828. The new standsInForMembers guard only hides the coordinator when members still need representation, so an active coordinator with all members terminal is counted as running/live between phases — fixes the zero-agents gap from #8720 without reintroducing #5807. Token aggregation now excludes workflow usage whenever members exist, avoiding double-count.

      Tests: pnpm exec vitest run packages/client-runtime/src/state/subagentRuntime.test.ts — 51 passed (2 new: between-phases and idle-member).

      Revert check: checking out main runtime with the PR test file fails counts a running workflow coordinator between phases (1 failed | 50 passed); restoring the PR file passes again. Low-risk, focused change.

      LGTM.

    6. Note

      This comment is posted by Julius' dot

      Closing because the visible count change lacks the UI evidence required by the verification rule. The tests cover the coordinator between phases, but the PR supplies no before/after screenshots or recording showing the composer banner, Agents footer, and badge during that gap. The linked phase-list recording in #8952 demonstrates a different fix. Attach screenshots of the affected counts and a short recording through a phase boundary, then request reconsideration.

    7. juliusmarminge closed this

Sign in to join this conversation.