Skip to content

fix: count streamed reasoning tokens in the live context meter - #1890

Merged
avoidwork merged 2 commits into
mainfrom
fix/reasoning-context-count
Nov 18, 2026
Merged

avoidwork merged 2 commits into
mainfrom
fix/reasoning-context-count

Conversation

@avoidwork

Copy link
Copy Markdown
Owner

Description

The live context meter ignored streamed reasoning, so the status bar under-reported during reasoning-heavy turns. Both reasoning paths (reasoning events and legacy on_chat_model_stream reasoning chunks) now feed the debounced token count.

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

Ran the TUI unit tests (607 pass, 0 fail) and lint (0 errors). No new test: src/tui/conversationArea.js is excluded from coverage and the change is display-only. Auto-compaction is unaffected because it recounts from the checkpointer.

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
@avoidwork
avoidwork merged commit 277623e into main Nov 18, 2026
2 checks passed
@avoidwork
avoidwork deleted the fix/reasoning-context-count branch November 18, 2026 22:37
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