File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,15 +210,22 @@ function SpinnerWithVerbInner({
210210 const hasRunningTeammates = runningTeammates . length > 0 ;
211211 const allIdle = hasRunningTeammates && runningTeammates . every ( t => t . isIdle ) ;
212212
213- // Gather aggregate token stats from all running swarm teammates
214- // In spinner-tree mode, skip aggregation (teammates have their own lines in the tree)
213+ // Gather aggregate token stats from all running agents.
214+ // In spinner-tree mode, skip in-process teammates (they have their own
215+ // per-teammate lines in the tree) but still count local-agent tasks
216+ // (background agents) which have no dedicated tree rows.
215217 let teammateTokens = 0 ;
216- if ( ! showSpinnerTree ) {
217- for ( const task of Object . values ( tasks ) ) {
218- if ( task . status === 'running' && ( isInProcessTeammateTask ( task ) || isLocalAgentTask ( task ) ) ) {
219- if ( task . progress ?. tokenCount ) {
220- teammateTokens += task . progress . tokenCount ;
221- }
218+ for ( const task of Object . values ( tasks ) ) {
219+ if ( task . status !== 'running' ) continue ;
220+ if ( isInProcessTeammateTask ( task ) ) {
221+ if ( ! showSpinnerTree && task . progress ?. tokenCount ) {
222+ teammateTokens += task . progress . tokenCount ;
223+ }
224+ continue ;
225+ }
226+ if ( isLocalAgentTask ( task ) ) {
227+ if ( task . progress ?. tokenCount ) {
228+ teammateTokens += task . progress . tokenCount ;
222229 }
223230 }
224231 }
You can’t perform that action at this time.
0 commit comments