hermes - 💡(How to fix) Fix Empty-content nudge fires when reasoning_content is populated (Ollama qwen3.5 / DeepSeek-R1 / any reasoning model with parser-split output) [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Root cause

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Environment

  • Hermes 0.12.0
  • Provider: custom (generic OpenAI Chat Completions transport)
  • Endpoint: Ollama 0.17.1 at http://ollama-gpu:11434/v1
  • Model: qwen3.5 (Ollama definition includes RENDERER qwen3.5 + PARSER qwen3.5)

Symptom

After a tool result, on turns where the model thinks, Hermes emits the ⚠️ Model returned empty after tool calls — nudging to continue status and triggers a retry — even though the model actually produced complete reasoning that arrived in reasoning_content. The
retry usually succeeds, so the user sees the warning followed by a valid answer, but the warning is noise and the retry is a wasted round-trip.

Root cause

run_agent.py:13677-13687 decides whether to fire the post-tool empty nudge. Its
inline-thinking check is:

_has_inline_thinking = bool(
re.search(r'<think>|<thinking>|<reasoning>', final_response or "", re.I) )
if ( _prior_was_tool
and not getattr(self, "_post_tool_empty_retried", False) and not _has_inline_thinking
):
# … fires nudge

When the upstream parser (Ollama's qwen3.5 PARSER, DeepSeek's reasoning channel, etc.)
splits thinking out of content and into reasoning_content, final_response is empty AND
has no <think> tag (the parser already stripped it). _has_inline_thinking is False, so
the nudge fires.

But reasoning_content is populated and is captured correctly elsewhere in the code
(run_agent.py:3318). The detection branch just doesn't consult it.

Reproduction

curl -s -X POST http://localhost:11434/v1/chat/completions -d '{ "model": "qwen3.5:latest",
"messages": [ {"role":"system","content":"You are an assistant."},
{"role":"user","content":"Save my preference: concise responses"}, {"role":"assistant","content":null,"tool_calls":[
{"id":"c1","type":"function","function":{"name":"memory_save","arguments":"{"v": "concise"}"}}
]},
{"role":"tool","tool_call_id":"c1","content":"Saved."}
]
}'

Returns:
{"choices":[{"message":{ "content":"",
"reasoning_content":"Thought: The user wants me to save…" }}]}

In Hermes, this triggers the empty-content nudge because the detection only checks content.

Suggested fix

Extend the inline-thinking check to also consider whether the assistant message has
populated reasoning fields. Approximate diff:

_has_separate_reasoning = bool(
getattr(assistant_message, "reasoning_content", None) or getattr(assistant_message, "reasoning", None) )
if ( _prior_was_tool
and not getattr(self, "_post_tool_empty_retried", False) and not _has_inline_thinking and not _has_separate_reasoning # ← new guard
): # … fire nudge

When reasoning came back in a separate channel, the model wasn't silent — its output was just split. This case should route to the same prefill path that handles inline
thinking, not to the empty-content nudge.

Also relevant

The same shape will affect any model where reasoning is delivered via a separate field
rather than inline tags — DeepSeek-R1 (reasoning_content on most providers), Qwen3 family on Ollama 0.5+, and forthcoming Moonshot/MiniMax variants that adopt the same
convention. Catching this once at the detection branch covers all of them.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING