Skip to content

spark-server: respect disabled MiniMax thinking#103

Open
lesserevil wants to merge 1 commit into
Avarok-Cybersecurity:mainfrom
lesserevil:fix/minimax-respect-disable-thinking
Open

spark-server: respect disabled MiniMax thinking#103
lesserevil wants to merge 1 commit into
Avarok-Cybersecurity:mainfrom
lesserevil:fix/minimax-respect-disable-thinking

Conversation

@lesserevil
Copy link
Copy Markdown

@lesserevil lesserevil commented May 29, 2026

Summary

MiniMax M2/M2.7's native HF template always appends an open <think> at the generation prompt. This adds an OpenAI-variant minimax_m2 template that keeps explicit thinking unchanged, but emits a closed <think>\n\n</think>\n\n prompt when a request resolves to enable_thinking=false, so default and tool-active requests no longer get forced or leaked reasoning despite thinking_default=false.

Closes #

Test plan

  • cargo fmt --all -- --check
  • cargo test -p spark-server --lib tokenizer::tests -- --nocapture
  • cargo test -p spark-server --lib tokenizer::tests::render_minimax_openai_template -- --nocapture
  • ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests -- -Dwarnings
  • Deployed on EP=2 MiniMax M2.7 and verified Reply with exactly: OK returns reasoning_tokens=0
  • ATLAS_SKIP_BUILD=1 cargo clippy --workspace --tests --all-features -- -Dwarnings (not runnable on Linux: enabling all features pulls in the Metal backend's Apple-only objc2 dependency, which compile-errors outside Apple targets)
  • bash scripts/check-license-headers.sh (script is not present in this checkout; CI uses SkyWalking Eyes with .licenserc.yaml, and this PR does not add any SPDX-covered source file type)
  • typos (not installed locally)
  • Added or updated tests where applicable

Notes for reviewers

The native MiniMax template path remains unchanged. The fix uses the existing jinja-templates/openai/{model_type}.jinja lookup, mirroring the Qwen OpenAI-variant path. MiniMax needed a closed-thinking prompt, not simply no <think> prompt: with no tag, the model can still emit an implicit reasoning trace followed by </think>.

CLA

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

@lesserevil lesserevil force-pushed the fix/minimax-respect-disable-thinking branch from 6f4db32 to f1734c6 Compare May 29, 2026 21:51
@lesserevil
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@lesserevil lesserevil force-pushed the fix/minimax-respect-disable-thinking branch from f1734c6 to bbad2e5 Compare May 29, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant