You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MiniMax M3 can emit provider reasoning in <mm:think>...</mm:think> blocks. The existing scrubbers already handled tags like <think>, <thinking>, <reasoning>, and <thought>, but not the MiniMax namespaced form, so those markers could leak into streamed gateway output, the CLI stream, and stored final assistant text.
This adds <mm:think> to the same scrub paths and covers all three surfaces with regression tests.
Tests
PYTHONPATH=. $HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_stream_consumer.py::TestFilterAndAccumulate::test_minimax_mm_think_tag_variant tests/cli/test_stream_delta_think_tag.py::TestRealReasoningBlock::test_minimax_mm_think_tag_suppressed tests/run_agent/test_run_agent.py::TestStripThinkBlocks::test_minimax_mm_think_block_removed -q before the fix, expected failure: 3 failed
PYTHONPATH=. $HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_stream_consumer.py::TestFilterAndAccumulate::test_minimax_mm_think_tag_variant tests/cli/test_stream_delta_think_tag.py::TestRealReasoningBlock::test_minimax_mm_think_tag_suppressed tests/run_agent/test_run_agent.py::TestStripThinkBlocks::test_minimax_mm_think_block_removed -q after the fix: 3 passed
Thanks for the fix. Closing this on a standing design line (same reason as #43836 and #43932, and the routing-based attempt in #59487): Hermes does not add scrubbing/parsing layers to strip a model's bespoke raw reasoning delimiters.
The <mm:think> markers reaching user-visible content is the provider/model emitting reasoning in a broken shape — the provider should be returning it in a separate field, not inline. Extending the shared think-block filters to chase each model's custom markers (<mm:think>, the Chinese 思考/反思/推理/推敲 variants, and whatever the next model emits) is an open-ended surface, and it masks the real issue instead of surfacing it. Some of these markers are also ordinary-word-shaped, not XML sentinels, so stripping them risks corrupting legitimate answers.
If you want reasoning split out of the visible channel for MiniMax-M3 today, point it at the OpenAI-compatible endpoint explicitly (MINIMAX_BASE_URL=https://api.minimax.io/v1 or model.base_url) — the MiniMax profile already sends reasoning_split: True on that route, so reasoning comes back in a separate field rather than inline.
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
comp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointcomp/cliCLI entry point, hermes_cli/, setup wizardcomp/gatewayGateway runner, session dispatch, deliveryP2Medium — degraded but workaround existsprovider/minimaxMiniMax (Anthropic transport)sweeper:risk-message-deliverySweeper risk: may drop, duplicate, misroute, or suppress messagestype/bugSomething isn't working
3 participants
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.
Summary
Fixes #59461.
MiniMax M3 can emit provider reasoning in
<mm:think>...</mm:think>blocks. The existing scrubbers already handled tags like<think>,<thinking>,<reasoning>, and<thought>, but not the MiniMax namespaced form, so those markers could leak into streamed gateway output, the CLI stream, and stored final assistant text.This adds
<mm:think>to the same scrub paths and covers all three surfaces with regression tests.Tests
PYTHONPATH=. $HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_stream_consumer.py::TestFilterAndAccumulate::test_minimax_mm_think_tag_variant tests/cli/test_stream_delta_think_tag.py::TestRealReasoningBlock::test_minimax_mm_think_tag_suppressed tests/run_agent/test_run_agent.py::TestStripThinkBlocks::test_minimax_mm_think_block_removed -qbefore the fix, expected failure: 3 failedPYTHONPATH=. $HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_stream_consumer.py::TestFilterAndAccumulate::test_minimax_mm_think_tag_variant tests/cli/test_stream_delta_think_tag.py::TestRealReasoningBlock::test_minimax_mm_think_tag_suppressed tests/run_agent/test_run_agent.py::TestStripThinkBlocks::test_minimax_mm_think_block_removed -qafter the fix: 3 passedPYTHONPATH=. $HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_stream_consumer.py::TestFilterAndAccumulate tests/gateway/test_stream_consumer.py::TestFilterAndAccumulateIntegration tests/cli/test_stream_delta_think_tag.py tests/run_agent/test_run_agent.py::TestStripThinkBlocks -q: 70 passedPYTHONPATH=. $HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_stream_consumer.py tests/cli/test_stream_delta_think_tag.py -q: 138 passedPYTHONPATH=. $HOME/.hermes/hermes-agent/venv/bin/python -m ruff check gateway/stream_consumer.py cli.py agent/agent_runtime_helpers.py tests/gateway/test_stream_consumer.py tests/cli/test_stream_delta_think_tag.py tests/run_agent/test_run_agent.py: All checks passed