Skip to content

Fix: show top-level reasoning field in thinking card - #169

Merged
nesquena merged 1 commit into
nesquena:masterfrom
tgaalman:fix/hermes-reasoning-display
Apr 7, 2026
Merged

Fix: show top-level reasoning field in thinking card#169
nesquena merged 1 commit into
nesquena:masterfrom
tgaalman:fix/hermes-reasoning-display

Conversation

@tgaalman

@tgaalman tgaalman commented Apr 7, 2026

Copy link
Copy Markdown

Problem

Hermes stores reasoning as a top-level message field (m.reasoning) instead of in content arrays like Claude (which uses content: [{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.reasoning after the content array check in renderMessages():

// Also check top-level reasoning field (Hermes format)
if(!thinkingText && m.reasoning){
  thinkingText=m.reasoning;
}

This allows Hermes users to see the model's reasoning process in the WebUI.

Testing

  • Patch applied locally on hermes-ai.gaalman.org
  • Reasoning cards now display correctly in WebUI

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 nesquena left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nesquena
nesquena merged commit ac969e4 into nesquena:master Apr 7, 2026
Ola-Turmo pushed a commit to Ola-Turmo/hermes-webui that referenced this pull request Apr 9, 2026
…splay

Fix: show top-level reasoning field in thinking card
@nesquena-hermes

Copy link
Copy Markdown
Collaborator

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.

JKJameson pushed a commit to JKJameson/hermes-webui that referenced this pull request Apr 25, 2026
…splay

Fix: show top-level reasoning field in thinking card
SysAdminDoc pushed a commit to SysAdminDoc/hermes-webui that referenced this pull request Jun 26, 2026
…splay

Fix: show top-level reasoning field in thinking card
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.

3 participants