fix(minimax): route M3 thinking controls to api.minimax.io/anthropic as well as /v1 - #19
fix(minimax): route M3 thinking controls to api.minimax.io/anthropic as well as /v1#19bbasketballer75 wants to merge 3 commits into
Conversation
…ndows The TUI dependency npm-install subprocess.run() call had no creationflags at all, unlike every other Windows-facing subprocess call in this codebase (which use windows_hide_flags() for exactly this). On a system where Windows Terminal is set as the default terminal-delegation handler, an unflagged console-subsystem child (npm.cmd) gets its own new, visible console -- even when spawned from an already-windowless pythonw.exe parent (e.g. a Windows Scheduled Task). Confirmed empirically on a live install: a Windows Terminal window appeared in lockstep with every dashboard restart that triggered this install path, and disappeared entirely once windows_hide_flags() was added. Adds a regression test in test_windows_subprocess_no_window_flags.py (the existing home for this exact contract across the codebase), verified to fail against the pre-fix code and pass against the fix.
…as well as /v1 (local WIP)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Routes MiniMax M3 “thinking” controls through the Anthropic-compatible MiniMax endpoint (/anthropic) in addition to the OpenAI-shaped /v1 path, so reasoning settings aren’t silently dropped when using the Anthropic route. Also hardens Windows subprocess spawning for TUI-related npm commands by applying hidden-console creation flags and adds a regression test.
Changes:
- Extend MiniMax provider M3 reasoning controls to apply on
https://api.minimax.io/anthropicas well as.../v1. - Add
creationflags=windows_hide_flags()to TUI npm subprocess calls to prevent visible console windows on Windows. - Add a Windows-focused unit test ensuring the TUI dependency install spawn includes hidden-console flags.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
plugins/model-providers/minimax/__init__.py |
Detects /anthropic base URL and emits M3 thinking controls on that route (plus existing /v1 behavior). |
hermes_cli/main.py |
Applies windows_hide_flags() to npm subprocess spawns used by TUI install/build flows. |
tests/test_windows_subprocess_no_window_flags.py |
Adds a regression test covering the TUI npm-install spawn’s Windows creationflags behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| result = subprocess.run( | ||
| [npm, "run", "build"], | ||
| cwd=str(ink_dir), | ||
| capture_output=True, | ||
| text=True, | ||
| encoding="utf-8", | ||
| errors="replace", | ||
| creationflags=windows_hide_flags(), |
| is_m3 = _is_minimax_m3(model) | ||
| is_oai = _is_minimax_global_openai_base_url(base_url) | ||
| is_ant = _is_minimax_global_anthropic_base_url(base_url) | ||
|
|
||
| if not is_m3 or (not is_oai and not is_ant): | ||
| return {}, {} |
|
Closing as redundant with upstream PR NousResearch#74205. Exact duplicate of the Verified by diffing this PR's substantive change against the upstream PR (ignoring the co-bundled 🤖 Closed by Claude Code during a repo cleanup audit. |
What this PR does
Headline fix in
plugins/model-providers/minimax/__init__.py(+40 lines on top of merged M3-thinking work): route M3 thinking controls toapi.minimax.io/anthropicas well as the/v1path.Why
The MiniMax provider shipped a custom URL set up so M3 thinking was routed through
/v1for the OpenAI-shaped side. The Anthropic-compatible sibling URL (/anthropicon the same host) was added later by the platform, and the provider code unconditionally falls back to OpenAI-shape endpoints in the Anthropic branch — which means an effort label sent via the Anthropic-shaped path was silently ignored. This branch detects the/anthropicsuffix (and equivalent from config) and preserves thinking controls across that route.Diff
Verification
api.minimax.io/anthropicwiththinking_effort=adaptive: response shows the requested effort label instead of dropping.plugins/model-providers/minimax/__init__.py, swap_apply_thinking_controls()forpass): response drops to default effort.Co-bundled tests
Each Tier-2 branch in this set carries a co-bundle of
hermes_cli/main.py(+13) andtests/test_windows_subprocess_no_window_flags.py(+37) — the windows_hide_flags addition on the TUI npm subprocess, plus its test scaffold. All five Tier-2 branches descend fromlocal/tui-install-windows-console-fix, so each inherits that parent. The windows_hide_flags addition is on the same Windows-subprocess family as these WIP changes; it is appropriate supporting infrastructure. If maintainers prefer a rebase-direct-to-mainfor each, happy to push rebased PRs — say the word.Related work
PR NousResearch#66694 / NousResearch#74205 (already open upstream for the OpenAI-shaped M3 thinking path). This branch closes the
/anthropicgap and is a companion, not a duplicate.