Skip to content

feat(ui): plumb reasoning stream + output-token count to the UI seam#5

Merged
lavindeep merged 1 commit into
ui-reworkfrom
feat/ui-thinking-stream
Jun 27, 2026
Merged

feat(ui): plumb reasoning stream + output-token count to the UI seam#5
lavindeep merged 1 commit into
ui-reworkfrom
feat/ui-thinking-stream

Conversation

@lavindeep

Copy link
Copy Markdown
Owner

Branch 1 of the UI v2 rework — thinking-stream plumbing, no visible change.

Threads the model's reasoning stream and output-token count to the UI seam so later branches can render a live reasoning readout. UI-agnostic; a default session is byte-identical.

  • on_thinking callback through OllamaClient.chat/_stream_chat + the LLMClient/RuntimeUI protocols, mirroring the existing on_token path.
  • Parse Ollama's eval_countMessage.output_tokens (defensive: absent / non-int → 0).
  • Runtime accumulates output tokens per turn → TurnStats.output_tokens.
  • TerminalUI.stream_thinking is a no-op → default session byte-identical.
  • Corrected the stale "never rendered/streamed" comments + DESIGN §24.6.

Phase gate green: ruff, ruff format, mypy --strict, 1262 tests (+7 red-first).

Add an on_thinking callback through OllamaClient.chat/_stream_chat and the
LLMClient/RuntimeUI protocols, mirroring the existing on_token path, and parse
Ollama's eval_count into Message.output_tokens. The runtime accumulates output
tokens per turn and surfaces the total in TurnStats. The current TerminalUI
consumes the new hook as a no-op, so a default session stays byte-identical; a
later full-screen UI renders the live reasoning readout.
@lavindeep lavindeep merged commit 5e33382 into ui-rework Jun 27, 2026
2 checks passed
@lavindeep lavindeep deleted the feat/ui-thinking-stream branch June 27, 2026 22:04
lavindeep added a commit that referenced this pull request Jul 2, 2026
feat(ui): plumb reasoning stream + output-token count to the UI seam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant