Skip to content

fix: count reasoning and tool calls in the live context counter - #1891

Open
avoidwork wants to merge 1 commit into
mainfrom
fix/context-counter-reasoning-tools
Open

avoidwork wants to merge 1 commit into
mainfrom
fix/context-counter-reasoning-tools

Conversation

@avoidwork

Copy link
Copy Markdown
Owner

Description

The live context counter ignored streamed reasoning and tool-call name/arguments. Both now feed the debounced token count, alongside the message text and tool results that were already counted. Replaces the earlier change in #1890, which had no test of the counter or the rendered status bar.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • CI / build / tooling

Testing

Added tests/unit/tui/conversationAreaContext.test.js (6 tests: message, reasoning, reasoning plus message, tool result, tool call, tool call plus result) and tests/integration/tui-status-bar-context.test.js (mounts ConversationArea and InputArea wired like App and asserts the rendered status bar shows 50% and 30%). With the source change stashed, 4 of the 6 unit tests and both integration tests fail. TUI suites pass (729/729); lint and format are clean. Not verified against a real model or a live TUI session.

Coverage

  • Line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with maintained line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

@avoidwork avoidwork added the bug Something isn't working label Nov 18, 2026
@avoidwork avoidwork self-assigned this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant