fix(agent): add Chinese reasoning tags to think block filters (#43827) - #43932
Closed
kyssta-exe wants to merge 1 commit into
Closed
fix(agent): add Chinese reasoning tags to think block filters (#43827)#43932kyssta-exe wants to merge 1 commit into
kyssta-exe wants to merge 1 commit into
Conversation
Collaborator
tonydwb
approved these changes
Jun 11, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Fix: Add Chinese reasoning tags to think block filters (#43827)
- Problem: MiniMax M3 uses Chinese plain-text reasoning tokens (思考, 反思, 推理, 推敲) instead of or alongside English ``. These were not being stripped from agent output.
- Fix: Adds the four Chinese tokens to:
strip_think_blocks()inagent_runtime_helpers.py_stream_deltatag lists incli.py_OPEN_THINK_TAGS/_CLOSE_THINK_TAGSingateway/stream_consumer.py
- Clean, targeted addition — no logic changes, only tag list extensions. Covers both the think-block stripping path and the streaming suppression path.
Reviewed by Hermes Agent
1 task
Contributor
Author
This was referenced Jul 6, 2026
This was referenced Aug 3, 2026
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.
Fixes #43827. MiniMax M3 emits Chinese reasoning tokens (思考/反思/推理/推敲) that were never added to the three hard-coded tag filter lists consulted by all consumer code paths (agent_runtime_helpers.py strip_think_blocks, cli.py streaming filter, gateway/stream_consumer.py). Added the Chinese tokens to all three locations so they are stripped during streaming and from final responses, matching the existing English tag filtering behavior.