Skip to content

fix(minimax): route M3 thinking controls to api.minimax.io/anthropic as well as /v1 - #19

Closed
bbasketballer75 wants to merge 3 commits into
mainfrom
fix/minimax-thinking-local-wip
Closed

fix(minimax): route M3 thinking controls to api.minimax.io/anthropic as well as /v1#19
bbasketballer75 wants to merge 3 commits into
mainfrom
fix/minimax-thinking-local-wip

Conversation

@bbasketballer75

Copy link
Copy Markdown
Owner

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 to api.minimax.io/anthropic as well as the /v1 path.

Why

The MiniMax provider shipped a custom URL set up so M3 thinking was routed through /v1 for the OpenAI-shaped side. The Anthropic-compatible sibling URL (/anthropic on 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 /anthropic suffix (and equivalent from config) and preserves thinking controls across that route.

Diff

hermes_cli/main.py                               | 13 ++++++++
plugins/model-providers/minimax/__init__.py      | 40 +++++++++++++++++-------
tests/test_windows_subprocess_no_window_flags.py | 37 ++++++++++++++++++++++
3 files changed, 78 insertions(+), 12 deletions(-)

Verification

  • Round-trip against api.minimax.io/anthropic with thinking_effort=adaptive: response shows the requested effort label instead of dropping.
  • Same call without the fix (open plugins/model-providers/minimax/__init__.py, swap _apply_thinking_controls() for pass): 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) and tests/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 from local/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-main for 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 /anthropic gap and is a companion, not a duplicate.

…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.
Copilot AI review requested due to automatic review settings July 31, 2026 20:58
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI 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.

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/anthropic as 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.

Comment thread hermes_cli/main.py
Comment on lines 2078 to +2085
result = subprocess.run(
[npm, "run", "build"],
cwd=str(ink_dir),
capture_output=True,
text=True,
encoding="utf-8",
errors="replace",
creationflags=windows_hide_flags(),
Comment on lines +58 to 63
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 {}, {}
@bbasketballer75

Copy link
Copy Markdown
Owner Author

Closing as redundant with upstream PR NousResearch#74205.

Exact duplicate of the /anthropic endpoint-recognition change in plugins/model-providers/minimax/__init__.py.

Verified by diffing this PR's substantive change against the upstream PR (ignoring the co-bundled hermes_cli/main.py + tests/test_windows_subprocess_no_window_flags.py windows_hide_flags change, which belongs to upstream NousResearch#66076). Also confirmed the fix is not yet on origin/main, so the upstream PR is still the live vehicle and nothing is lost by closing this one.

🤖 Closed by Claude Code during a repo cleanup audit.

@bbasketballer75
bbasketballer75 deleted the fix/minimax-thinking-local-wip branch August 1, 2026 02:45
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.

2 participants