Skip to content

Context window token count display broken for Claude modelsΒ #5726

@joe-hireable

Description

@joe-hireable

Issue Description

The context window token count display in Roo Code is not working correctly when using Claude models (via any provider). This affects all Claude models, including Claude 4 Sonnet.

Specific Problems

  1. Incorrect Token Limit Display: Claude 4 Sonnet has a 1 million token context window capacity, but Roo Code only allows/displays 200k tokens maximum.

  2. Context Condensing Functionality Breaking: The broken token count affects the context condensing functionality in two ways:

    • When condensing context is enabled automatically
    • When running condensing manually using the "condense context" button next to the token counter display

Impact

This issue prevents users from utilizing the full context window capabilities of Claude models, particularly Claude 4 Sonnet which has a significantly larger context window than what's being allowed. It also makes the condensing feature unreliable as it's operating based on incorrect token counts.

Environment

  • Models affected: All Claude models via any provider
  • Specific example: Claude 4 Sonnet (1M token capacity shows as 200k)

Expected Behavior

  • Context window token count should accurately reflect the actual capacity of each Claude model
  • Claude 4 Sonnet should show 1M token capacity instead of 200k
  • Context condensing should work properly based on accurate token counts

Thank you for looking into this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions