fix(display): show reasoning before response when tool calls suppress content#3566
Merged
Conversation
… user override The minimax-specific auto-correction in runtime_provider.py was preventing users from overriding to the OpenAI-compatible endpoint via MINIMAX_BASE_URL. Users in certain regions get nginx 404 on api.minimax.io/anthropic and need to switch to api.minimax.chat/v1. The generic URL-suffix detection already handles /anthropic → anthropic_messages, so the minimax-specific code was redundant for the default path and harmful for the override path. Now: default /anthropic URL works via generic detection, user override to /v1 gets chat_completions mode naturally. Closes #3546 (different approach — respects user overrides instead of changing the default endpoint).
…ppress content When a model generates content (containing <REASONING_SCRATCHPAD> tags) alongside tool calls in the same API response, content deltas were suppressed from streaming once any tool call chunk arrived. This prevented the CLI's tag extraction from running, so reasoning was never shown during streaming. The post-response fallback then displayed reasoning AFTER the already-visible streamed response, creating a confusing reversed order. Fix: route suppressed content to stream_delta_callback even when tool calls are present. The CLI's _stream_delta handles tag extraction — reasoning tags are routed to the reasoning display box, while non-reasoning text is handled by the existing stream display logic. This ensures reasoning appears before tool execution and the final response, matching the expected visual order.
Contributor
|
This was referenced Mar 28, 2026
teknium1
added a commit
that referenced
this pull request
Mar 28, 2026
PR #3566 intentionally routes suppressed content to stream_delta_callback when tool calls are present, so reasoning tag extraction can fire during streaming. The test was still asserting the old behavior where content after tool calls was fully suppressed from the callback. Updated the assertion to match: content IS delivered to the callback (for tag extraction), with display-level suppression handled by the CLI's _stream_delta.
teknium1
added a commit
that referenced
this pull request
Mar 28, 2026
…3574) PR #3566 intentionally routes suppressed content to stream_delta_callback when tool calls are present, so reasoning tag extraction can fire during streaming. The test was still asserting the old behavior where content after tool calls was fully suppressed from the callback. Updated the assertion to match: content IS delivered to the callback (for tag extraction), with display-level suppression handled by the CLI's _stream_delta.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
… content (NousResearch#3566) * fix(provider): remove MiniMax /v1→/anthropic auto-correction to allow user override The minimax-specific auto-correction in runtime_provider.py was preventing users from overriding to the OpenAI-compatible endpoint via MINIMAX_BASE_URL. Users in certain regions get nginx 404 on api.minimax.io/anthropic and need to switch to api.minimax.chat/v1. The generic URL-suffix detection already handles /anthropic → anthropic_messages, so the minimax-specific code was redundant for the default path and harmful for the override path. Now: default /anthropic URL works via generic detection, user override to /v1 gets chat_completions mode naturally. Closes NousResearch#3546 (different approach — respects user overrides instead of changing the default endpoint). * fix(display): show reasoning during streaming even when tool calls suppress content When a model generates content (containing <REASONING_SCRATCHPAD> tags) alongside tool calls in the same API response, content deltas were suppressed from streaming once any tool call chunk arrived. This prevented the CLI's tag extraction from running, so reasoning was never shown during streaming. The post-response fallback then displayed reasoning AFTER the already-visible streamed response, creating a confusing reversed order. Fix: route suppressed content to stream_delta_callback even when tool calls are present. The CLI's _stream_delta handles tag extraction — reasoning tags are routed to the reasoning display box, while non-reasoning text is handled by the existing stream display logic. This ensures reasoning appears before tool execution and the final response, matching the expected visual order.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…or change (NousResearch#3574) PR NousResearch#3566 intentionally routes suppressed content to stream_delta_callback when tool calls are present, so reasoning tag extraction can fire during streaming. The test was still asserting the old behavior where content after tool calls was fully suppressed from the callback. Updated the assertion to match: content IS delivered to the callback (for tag extraction), with display-level suppression handled by the CLI's _stream_delta.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
… content (NousResearch#3566) * fix(provider): remove MiniMax /v1→/anthropic auto-correction to allow user override The minimax-specific auto-correction in runtime_provider.py was preventing users from overriding to the OpenAI-compatible endpoint via MINIMAX_BASE_URL. Users in certain regions get nginx 404 on api.minimax.io/anthropic and need to switch to api.minimax.chat/v1. The generic URL-suffix detection already handles /anthropic → anthropic_messages, so the minimax-specific code was redundant for the default path and harmful for the override path. Now: default /anthropic URL works via generic detection, user override to /v1 gets chat_completions mode naturally. Closes NousResearch#3546 (different approach — respects user overrides instead of changing the default endpoint). * fix(display): show reasoning during streaming even when tool calls suppress content When a model generates content (containing <REASONING_SCRATCHPAD> tags) alongside tool calls in the same API response, content deltas were suppressed from streaming once any tool call chunk arrived. This prevented the CLI's tag extraction from running, so reasoning was never shown during streaming. The post-response fallback then displayed reasoning AFTER the already-visible streamed response, creating a confusing reversed order. Fix: route suppressed content to stream_delta_callback even when tool calls are present. The CLI's _stream_delta handles tag extraction — reasoning tags are routed to the reasoning display box, while non-reasoning text is handled by the existing stream display logic. This ensures reasoning appears before tool execution and the final response, matching the expected visual order.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…or change (NousResearch#3574) PR NousResearch#3566 intentionally routes suppressed content to stream_delta_callback when tool calls are present, so reasoning tag extraction can fire during streaming. The test was still asserting the old behavior where content after tool calls was fully suppressed from the callback. Updated the assertion to match: content IS delivered to the callback (for tag extraction), with display-level suppression handled by the CLI's _stream_delta.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
… content (NousResearch#3566) * fix(provider): remove MiniMax /v1→/anthropic auto-correction to allow user override The minimax-specific auto-correction in runtime_provider.py was preventing users from overriding to the OpenAI-compatible endpoint via MINIMAX_BASE_URL. Users in certain regions get nginx 404 on api.minimax.io/anthropic and need to switch to api.minimax.chat/v1. The generic URL-suffix detection already handles /anthropic → anthropic_messages, so the minimax-specific code was redundant for the default path and harmful for the override path. Now: default /anthropic URL works via generic detection, user override to /v1 gets chat_completions mode naturally. Closes NousResearch#3546 (different approach — respects user overrides instead of changing the default endpoint). * fix(display): show reasoning during streaming even when tool calls suppress content When a model generates content (containing <REASONING_SCRATCHPAD> tags) alongside tool calls in the same API response, content deltas were suppressed from streaming once any tool call chunk arrived. This prevented the CLI's tag extraction from running, so reasoning was never shown during streaming. The post-response fallback then displayed reasoning AFTER the already-visible streamed response, creating a confusing reversed order. Fix: route suppressed content to stream_delta_callback even when tool calls are present. The CLI's _stream_delta handles tag extraction — reasoning tags are routed to the reasoning display box, while non-reasoning text is handled by the existing stream display logic. This ensures reasoning appears before tool execution and the final response, matching the expected visual order.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
…or change (NousResearch#3574) PR NousResearch#3566 intentionally routes suppressed content to stream_delta_callback when tool calls are present, so reasoning tag extraction can fire during streaming. The test was still asserting the old behavior where content after tool calls was fully suppressed from the callback. Updated the assertion to match: content IS delivered to the callback (for tag extraction), with display-level suppression handled by the CLI's _stream_delta.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
… content (NousResearch#3566) * fix(provider): remove MiniMax /v1→/anthropic auto-correction to allow user override The minimax-specific auto-correction in runtime_provider.py was preventing users from overriding to the OpenAI-compatible endpoint via MINIMAX_BASE_URL. Users in certain regions get nginx 404 on api.minimax.io/anthropic and need to switch to api.minimax.chat/v1. The generic URL-suffix detection already handles /anthropic → anthropic_messages, so the minimax-specific code was redundant for the default path and harmful for the override path. Now: default /anthropic URL works via generic detection, user override to /v1 gets chat_completions mode naturally. Closes NousResearch#3546 (different approach — respects user overrides instead of changing the default endpoint). * fix(display): show reasoning during streaming even when tool calls suppress content When a model generates content (containing <REASONING_SCRATCHPAD> tags) alongside tool calls in the same API response, content deltas were suppressed from streaming once any tool call chunk arrived. This prevented the CLI's tag extraction from running, so reasoning was never shown during streaming. The post-response fallback then displayed reasoning AFTER the already-visible streamed response, creating a confusing reversed order. Fix: route suppressed content to stream_delta_callback even when tool calls are present. The CLI's _stream_delta handles tag extraction — reasoning tags are routed to the reasoning display box, while non-reasoning text is handled by the existing stream display logic. This ensures reasoning appears before tool execution and the final response, matching the expected visual order.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…or change (NousResearch#3574) PR NousResearch#3566 intentionally routes suppressed content to stream_delta_callback when tool calls are present, so reasoning tag extraction can fire during streaming. The test was still asserting the old behavior where content after tool calls was fully suppressed from the callback. Updated the assertion to match: content IS delivered to the callback (for tag extraction), with display-level suppression handled by the CLI's _stream_delta.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
… content (NousResearch#3566) * fix(provider): remove MiniMax /v1→/anthropic auto-correction to allow user override The minimax-specific auto-correction in runtime_provider.py was preventing users from overriding to the OpenAI-compatible endpoint via MINIMAX_BASE_URL. Users in certain regions get nginx 404 on api.minimax.io/anthropic and need to switch to api.minimax.chat/v1. The generic URL-suffix detection already handles /anthropic → anthropic_messages, so the minimax-specific code was redundant for the default path and harmful for the override path. Now: default /anthropic URL works via generic detection, user override to /v1 gets chat_completions mode naturally. Closes NousResearch#3546 (different approach — respects user overrides instead of changing the default endpoint). * fix(display): show reasoning during streaming even when tool calls suppress content When a model generates content (containing <REASONING_SCRATCHPAD> tags) alongside tool calls in the same API response, content deltas were suppressed from streaming once any tool call chunk arrived. This prevented the CLI's tag extraction from running, so reasoning was never shown during streaming. The post-response fallback then displayed reasoning AFTER the already-visible streamed response, creating a confusing reversed order. Fix: route suppressed content to stream_delta_callback even when tool calls are present. The CLI's _stream_delta handles tag extraction — reasoning tags are routed to the reasoning display box, while non-reasoning text is handled by the existing stream display logic. This ensures reasoning appears before tool execution and the final response, matching the expected visual order.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…or change (NousResearch#3574) PR NousResearch#3566 intentionally routes suppressed content to stream_delta_callback when tool calls are present, so reasoning tag extraction can fire during streaming. The test was still asserting the old behavior where content after tool calls was fully suppressed from the callback. Updated the assertion to match: content IS delivered to the callback (for tag extraction), with display-level suppression handled by the CLI's _stream_delta.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When reasoning display is enabled (
/reasoning show) and the model generates content with<REASONING_SCRATCHPAD>tags alongside tool calls, the reasoning box appeared AFTER the already-streamed response — reversed from the expected order.Root Cause
In the chat completions streaming loop (
run_agent.pyline 3902), content deltas are suppressed from the stream callback once any tool call delta arrives (if not tool_calls_acc). This is intentional — it prevents chatty "I'll use the tool..." text from displaying alongside tool execution.But it also suppresses reasoning tags in the content from reaching the CLI's
_stream_deltatag extraction. Since the reasoning is never extracted during streaming,_reasoning_shown_this_turnstays False, and the post-response fallback fires — displaying the reasoning BELOW the already-visible streamed response.Fix
Route suppressed content to
stream_delta_callbackeven when tool calls are present. The CLI's_stream_deltahandles tag extraction — reasoning tags are routed to the reasoning display box, while non-reasoning text is handled by the existing stream display logic.Before/After
Before: Reasoning → Tool calls → Response → Reasoning box (wrong — reasoning shown after response)
After: Reasoning box → Tool calls → Response (correct order)