mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
Merge pull request #1228 from Evsdrg/fix/spinner-tree-local-agent-tokens
fix: showSpinnerTree 模式下保留 local-agent token 显示
This commit is contained in:
@@ -210,15 +210,22 @@ function SpinnerWithVerbInner({
|
|||||||
const hasRunningTeammates = runningTeammates.length > 0;
|
const hasRunningTeammates = runningTeammates.length > 0;
|
||||||
const allIdle = hasRunningTeammates && runningTeammates.every(t => t.isIdle);
|
const allIdle = hasRunningTeammates && runningTeammates.every(t => t.isIdle);
|
||||||
|
|
||||||
// Gather aggregate token stats from all running swarm teammates
|
// Gather aggregate token stats from all running agents.
|
||||||
// In spinner-tree mode, skip aggregation (teammates have their own lines in the tree)
|
// In spinner-tree mode, skip in-process teammates (they have their own
|
||||||
|
// per-teammate lines in the tree) but still count local-agent tasks
|
||||||
|
// (background agents) which have no dedicated tree rows.
|
||||||
let teammateTokens = 0;
|
let teammateTokens = 0;
|
||||||
if (!showSpinnerTree) {
|
for (const task of Object.values(tasks)) {
|
||||||
for (const task of Object.values(tasks)) {
|
if (task.status !== 'running') continue;
|
||||||
if (task.status === 'running' && (isInProcessTeammateTask(task) || isLocalAgentTask(task))) {
|
if (isInProcessTeammateTask(task)) {
|
||||||
if (task.progress?.tokenCount) {
|
if (!showSpinnerTree && task.progress?.tokenCount) {
|
||||||
teammateTokens += task.progress.tokenCount;
|
teammateTokens += task.progress.tokenCount;
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (isLocalAgentTask(task)) {
|
||||||
|
if (task.progress?.tokenCount) {
|
||||||
|
teammateTokens += task.progress.tokenCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user