mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
The gateway was gating `reasoning.delta` and `reasoning.available` behind `_reasoning_visible(sid)` (true iff `display.show_reasoning: true` or `tool_progress_mode: verbose`). With the default config, neither was true — so reasoning events never reached the TUI, `turn.reasoning` stayed empty, `reasoningTokens` stayed 0, and the Thinking expander showed no token label for the whole turn. Tools still reported tokens because `tool.start` had no such gate. Then `message.complete` fired with `payload.reasoning` populated, the TUI saved it into `msg.thinking`, and the finalized row's expander sprouted "~36 tokens" post-hoc. That's the "tokens appear after the turn" jank. Remove the gate on emission. The TUI is responsible for whether to display reasoning content (detailsMode + collapsed expander already handle that). Token counting becomes continuous throughout the turn, matching how tools work. Also dropped the now-unused `_reasoning_visible` and `_session_show_reasoning` helpers. `show_reasoning` config key stays in place — it's still toggled via `/reasoning show|hide` and read elsewhere for potential future TUI-side gating. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| entry.py | ||
| render.py | ||
| server.py | ||
| slash_worker.py | ||