Fix: show top-level reasoning field in thinking card - #169
Conversation
Hermes stores reasoning as a top-level message field (m.reasoning) instead of in content arrays like Claude. This patch makes the thinking/reasoning card also check for m.reasoning, so users can see the model's reasoning process in the WebUI.
nesquena
left a comment
There was a problem hiding this comment.
Thanks @tgaalman! Clean, minimal fix for a real gap — Hermes-format reasoning (m.reasoning top-level field) was invisible in the UI while Claude-format reasoning (content array with type: 'reasoning') worked fine.
The fallback check is correctly guarded (!thinkingText && m.reasoning) so it only activates when the structured content array didn't already extract reasoning. The output is properly escaped via esc() in the thinking card <pre> block.
Security audit clean (4-line JS change, no external resources, XSS-safe). Tests: 442 passed, 0 failed. Merging now.
…splay Fix: show top-level reasoning field in thinking card
|
Thank you, @tgaalman! Your fix for the top-level reasoning field in the thinking card is in and has been running since v0.39.0. Thank you for the catch — that's exactly the kind of edge case that's hard to spot without using the feature in anger. You're in the Contributors section. |
…splay Fix: show top-level reasoning field in thinking card
…splay Fix: show top-level reasoning field in thinking card
Problem
Hermes stores reasoning as a top-level message field (
m.reasoning) instead of in content arrays like Claude (which usescontent: [{type: 'reasoning', reasoning: '...'}]).The WebUI thinking/reasoning card only checked for structured content arrays, so Hermes reasoning was never displayed.
Fix
Added a fallback check for
m.reasoningafter the content array check inrenderMessages():This allows Hermes users to see the model's reasoning process in the WebUI.
Testing