Add context token counter: 64k default, live UI display
- config: ollama_num_ctx default 8192 β†’ 65536
- LLMChunk: add prompt_tokens / completion_tokens fields
- OllamaBackend.stream: populate token counts from final chunk
  (prompt_eval_count + eval_count when chunk.done)
- StreamEnd: add context_tokens and max_context_tokens
- Agent.run_stream: capture token counts, pass to StreamEnd
- websocket: include context_tokens / max_context_tokens in stream_end
- index.html: split chat-header into title span + token-counter span
- sidebar.js: updateChatHeader targets #chat-header-title, not innerHTML
- app.js: updateTokenCounter() shows "X/Y (Z%) tokens", colors:
  gray <50%, amber 50–79%, red β‰₯80%
- style.css: .token-counter, .warn, .danger styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f5f8d90 commit 9c0c6b31199f458f38147906483c322b9ce87371
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 8 Apr
Showing 9 changed files
View
client/index.html
View
client/js/app.js
View
client/js/sidebar.js
View
client/style.css
View
navi/api/websocket.py
View
navi/config.py
View
navi/core/agent.py
View
navi/llm/base.py
View
navi/llm/ollama.py