fix(ollama): hide native reasoning-only output#45330
Merged
Conversation
Contributor
Greptile SummaryThis PR completes the fix for native Ollama reasoning leakage by removing the Key changes:
The implementation is minimal, well-scoped, and fully covered by the updated test suite. Confidence Score: 5/5
Last reviewed commit: af15e4f |
Contributor
Author
z-hao-wang
pushed a commit
to z-hao-wang/openclaw
that referenced
this pull request
Mar 13, 2026
…@xi7ang Co-authored-by: xi7ang <[email protected]> Co-authored-by: Frank Yang <[email protected]>
frankekn
added a commit
to xinhuagu/openclaw
that referenced
this pull request
Mar 14, 2026
…@xi7ang Co-authored-by: xi7ang <[email protected]> Co-authored-by: Frank Yang <[email protected]>
caicongyang
pushed a commit
to caicongyang/openclaw
that referenced
this pull request
Mar 14, 2026
… messages When using reasoning models (KiloCode, NVIDIA Nemotron, etc.), Telegram was sending duplicate messages because thinking/reasoning content was being used as fallback response content. This fix imports stripThinkingTagsFromText and applies it to the fallback logic in handleMessageEnd, ensuring reasoning tokens don't appear in the final response. This generalizes the Ollama fix (openclaw#45330) to work for ALL reasoning models. Also fixes issue openclaw#45955: Clear session runtime model on config changes so UI model switching takes effect immediately without requiring full gateway restart. Fixes: openclaw#45965 Fixes: openclaw#45955
ecochran76
pushed a commit
to ecochran76/openclaw
that referenced
this pull request
Mar 14, 2026
…@xi7ang Co-authored-by: xi7ang <[email protected]> Co-authored-by: Frank Yang <[email protected]>
5 tasks
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.
Description
Hide Ollama native
thinking/reasoningoutput from final assistant replies by removing the remaining streaming fallback path as well.This replacement continues the work from #45317 and fixes the part that was still leaking native reasoning through the streaming aggregation path.
Original contributor: @xi7ang
Supersedes: #45317
Fixes: #45169
Root Cause
buildAssistantMessage()was changed to ignorethinking/reasoning, butcreateOllamaStreamFn()still accumulated those fields intofallbackContentand copied that fallback intofinalResponse.message.contentbefore building the final assistant message.Changes
message.contentfallbackContentpath that promotedthinking/reasoninginto final textollama-streamtests to assert that reasoning-only output stays hiddenTesting
pnpm buildpnpm checkpnpm test