Fix token counting: show only completion tokens, not cumulative prompt+completion
The token_count displayed next to assistant messages was summing
prompt_tokens + completion_tokens across ALL tool-calling iterations,
giving hundreds of thousands of tokens for multi-turn conversations.

Now:
- token_count (coins icon) = only completion tokens generated by the model
- context_tokens (ContextBar) = only prompt tokens (context size sent to LLM)

This gives users a realistic measure of how much the model actually generated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 119776a commit e04b4ca8c8e9b585991f70ff66444babc5e5b535
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 21 May
Showing 4 changed files
View
navi/core/agent.py
View
navi/core/events.py
View
navi/core/subagent_runner.py
View
tests/unit/core/test_agent.py