mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55: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 allIdle = hasRunningTeammates && runningTeammates.every(t => t.isIdle);
|
||||
|
||||
// Gather aggregate token stats from all running swarm teammates
|
||||
// In spinner-tree mode, skip aggregation (teammates have their own lines in the tree)
|
||||
// Gather aggregate token stats from all running agents.
|
||||
// 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;
|
||||
if (!showSpinnerTree) {
|
||||
for (const task of Object.values(tasks)) {
|
||||
if (task.status === 'running' && (isInProcessTeammateTask(task) || isLocalAgentTask(task))) {
|
||||
if (task.progress?.tokenCount) {
|
||||
teammateTokens += task.progress.tokenCount;
|
||||
}
|
||||
for (const task of Object.values(tasks)) {
|
||||
if (task.status !== 'running') continue;
|
||||
if (isInProcessTeammateTask(task)) {
|
||||
if (!showSpinnerTree && 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