Skip to content

[BUG] UI Bug: Output tokens display only shows last API call instead of cumulative total #1670

Description

@goran-vidas

Problem Description

There is an inconsistency/bug in how tokens are displayed in the UI when a task involves multiple API calls (e.g., using tools like read_file).

  • Input tokens (): Displays the cumulative sum of all API calls within the task (Correct).
  • Output tokens (): Overwrites the value and displays ONLY the output tokens from the last API response, instead of the cumulative total.

Steps to Reproduce

  1. Run a task in Architect or Code mode that requires a tool execution (e.g., asking to read a file).
  2. Observe the first API call (e.g., tool call generated ~270 output tokens).
  3. Approve the tool call and wait for the second API call (e.g., summary response ~270 output tokens).
  4. Check the UI status bar vs. Google Gemini Dashboard / Provider logs.

Expected Behavior

Output tokens should show the cumulative total of generated tokens for the entire task (e.g., ~540 tokens), matching the provider's billing metrics, just like Input tokens does.

Actual Behavior

The UI displays only the last call's output tokens (e.g., 270), misleading the user about the actual total output token count used during the session.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions