Skip to content

fix(agent): add Chinese reasoning tags to think block filters (#43827) - #43932

Closed
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-43827
Closed

fix(agent): add Chinese reasoning tags to think block filters (#43827)#43932
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-43827

Conversation

@kyssta-exe

Copy link
Copy Markdown
Contributor

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.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery provider/minimax MiniMax (Anthropic transport) duplicate This issue or pull request already exists labels Jun 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #43836 — both add the four MiniMax-M3 Chinese reasoning tags (思考/反思/推理/推敲) to the same three think-block filter sites (agent_runtime_helpers, cli, gateway/stream_consumer) for #43827. #43836 is the earliest open PR. See also #43839 (same goal, shared-scrubber mechanism).

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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() in agent_runtime_helpers.py
    • _stream_delta tag lists in cli.py
    • _OPEN_THINK_TAGS/_CLOSE_THINK_TAGS in gateway/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

@kyssta-exe

Copy link
Copy Markdown
Contributor Author

Duplicate of #43836 — same Chinese reasoning tag additions for #43827. Closing as superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists provider/minimax MiniMax (Anthropic transport) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Chinese reasoning tags ( 思考 / 反思 / 推理 / 推敲) from MiniMax-M3 leak to user output in streaming + final response

3 participants