fix(client-runtime): count workflows between phases #8749
Closedyashranaway(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/8749/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- packages/client-runtime/src/state/subagentRuntime.ts line 836Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -826,13 +826,11 @@826826 let settledCount = 0;827827 let totalTokens = 0;828828 for (const agent of source) {829- // A workflow coordinator with members is a container for those members, not830- // work of its own: it reports running for the whole run and aggregates their831- // usage upstream in some providers. Counting it would report one more agent832- // working than there are, and double count tokens.833- if (agent.kind === "workflow" && (members.get(agent.id) ?? []).length > 0) continue;834- if (agent.status === "running" || agent.status === "pending") runningCount += 1;835- else if (agent.status === "waiting") waitingCount += 1;836- else if (agent.status === "idle") idleCount += 1;837- else settledCount += 1;838- totalTokens += agent.usage?.totalTokens ?? 0;829+ const workflowMembers = members.get(agent.id) ?? [];830+ const standsInForMembers =831+ agent.kind === "workflow" &&832+ workflowMembers.length > 0 &&833+ !(834+ isActiveSubagentStatus(agent.status) &&835+ !workflowMembers.some((member) => isActiveSubagentStatus(member.status))836+ );
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
c29483f9-6a9d-465b-9786-f223ba8856d8You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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.