fix(inference): point MiniMax at its OpenAI-compatible /v1 endpoint (#3401)#3402
fix(inference): point MiniMax at its OpenAI-compatible /v1 endpoint (#3401)#3402oxoxDev wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughMiniMax cloud provider configuration is switched from Anthropic-style endpoint and authentication to OpenAI-compatible ChangesMiniMax Provider OpenAI-Compatible API Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
f17d02c to
a4bfba7
Compare
…inyhumansai#3401) MiniMax was registered with endpoint https://api.minimax.io/anthropic + AuthStyle::Anthropic (tinyhumansai#3062). But OpenHuman has no Anthropic Messages provider — AuthStyle::Anthropic only changes the auth header; chat still builds {endpoint}/chat/completions and list_models builds {endpoint}/models. That base only serves MiniMax's Anthropic Messages API, so both /anthropic/chat/completions and /anthropic/models returned 404 — the model-listing 404 was Sentry TAURI-RUST-8X3 (236 events / 30 users). MiniMax exposes a full OpenAI-compatible surface at /v1 (verified: /v1/models and /v1/chat/completions both respond 401, i.e. exist). Point the catalog entry (Rust + frontend mirror) there with Bearer auth so both model-listing and chat resolve. No error-handling change — a genuine 404 from any provider still surfaces, per tinyhumansai#2959. Closes tinyhumansai#3401
a4bfba7 to
24bf14b
Compare
sanil-23
left a comment
There was a problem hiding this comment.
Approve ✅
Traced how endpoint + auth_style actually flow through the inference layer to confirm the root-cause claim holds. The fix is correct, minimal, and well-tested.
Correctness — verified
The comments' root-cause explanation is accurate, and the code confirms it:
- In
factory.rs,AuthStyle::Anthropicdoes not build an Anthropic Messages-protocol client — it builds an OpenAI-compatible provider that still POSTs to{base}/chat/completionsand lists{base}/models, only swapping the auth headers tox-api-key+anthropic-version. - So the old config hit
https://api.minimax.io/anthropic/chat/completionsand/anthropic/models— neither exists on MiniMax's Anthropic surface (which lives at/anthropic/v1/messages), hence the 404s (incl.TAURI-RUST-8X3). /v1+Bearernow resolves tohttps://api.minimax.io/v1/chat/completionsand/v1/modelswithAuthorization: Bearer— MiniMax's documented OpenAI-compatible surface. Both chat and model-listing now resolve.
Completeness
- Both catalogs (TS
builtinCloudProviders.ts+ Rustcloud_providers.rs) kept in sync, with comments explicitly calling out the sync requirement. - Tests updated in all four relevant places (TS unit, TS
AIPanelintegration, Rust defaults, Rust legacy-migration e2e). - No collateral:
is_minimax_aliasis a dead stub; system-role-rejection and<think>-stripping key on model-id patterns, not the endpoint.
One non-blocking note
Already-connected MiniMax users are not auto-migrated. migrate_legacy_fields only fills endpoint when empty and only overrides auth_style when it's still the default Bearer. A user who previously connected MiniMax through the UI has a persisted entry with endpoint=".../anthropic" and auth_style=Anthropic, so neither gets rewritten — those connections stay 404'd until the provider is re-added. New connections and endpoint-less legacy type=minimax configs (covered by the e2e test) do get the fix. Closing the gap would need a one-time migration to rewrite stale built-in endpoints — reasonably out of scope here, but worth a mention in the description or a follow-up.
Summary
openhuman.inference_list_modelsfiredprovider returned 404: 404 page not foundfor the MiniMax builtin provider (Sentry TAURI-RUST-8X3: 236 events / 30 users, live on 0.57.13, all platforms). Root cause: MiniMax's catalog entry pointed at its Anthropic Messages base (…/anthropic) with Anthropic auth, but OpenHuman only speaks the OpenAI chat-completions dialect — so the probe built…/anthropic/models, a path MiniMax doesn't serve. Fix: point MiniMax at its OpenAI-compatible/v1surface with Bearer auth.Problem
list_configured_models(src/openhuman/inference/provider/ops.rs) builds{endpoint}/models, and the chat provider (compatible.rs) builds{endpoint}/chat/completions— both OpenAI-style paths. OpenHuman has no Anthropic Messages provider;AuthStyle::Anthropiconly swaps the auth header, it still hits/chat/completionsand/models.MiniMax was added in #3062 with
endpoint = https://api.minimax.io/anthropic+AuthStyle::Anthropic. That base only serves the Anthropic Messages protocol (/anthropic/v1/messages), so with OpenHuman's OpenAI paths both endpoints 404:…/anthropic/models(list_models)…/anthropic/chat/completions(chat)MiniMax's actual OpenAI-compatible surface (verified by live probe) does serve both:
https://api.minimax.io/v1/models401— exists, Bearer authhttps://api.minimax.io/v1/chat/completions401— exists, Bearer authThis 404 is exactly the class of failure #2959 ("revert: remove all Sentry error suppression") intended to surface for a root-cause fix, not re-suppress — so the fix corrects the misconfiguration rather than swallowing the error.
Solution
Correct the MiniMax catalog entry (Rust
BUILTIN_CLOUD_PROVIDERS+ the frontend mirrorbuiltinCloudProviders.ts, kept in sync):endpoint:https://api.minimax.io/anthropic→https://api.minimax.io/v1auth_style:Anthropic→BearerNow
list_models→…/v1/models✓ and chat →…/v1/chat/completions✓. No change to the probe's 404 handling: a genuine 404 from any provider still errors and reaches Sentry, per #2959.No suppression, no probe-skipping, no synthetic empty result — the failing operation now actually succeeds.
Submission Checklist
builtinCloudProviders.test.ts+AIPanel.test.tsxMiniMax-connect testN/A: configuration correction, no feature added/removed/renamed## Related— N/A (config correction)Closes #NNNin the## RelatedsectionImpact
/v1/models) — AI-settings dropdown populates and save succeeds./v1/chat/completions).Note: a quick sweep of the other catalog providers found their
/modelsendpoints resolve (401/200); MiniMax was the structural outlier. (google's OpenAI-compat/models404s unauthenticated but is key-gated — unconfirmed in this Sentry issue; left for separate verification.)Related
Closes #3401
Sentry-Issue: TAURI-RUST-8X3
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
N/A — GitHub issue #3401 (from Sentry TAURI-RUST-8X3).
Commit & Branch
Branch
fix/3401-list-models-discovery; single commit correcting the MiniMax catalog entry (Rust + frontend mirror) and updating the affected tests.Validation Run
pnpm --filter openhuman-app format:check(prettier — changed files clean)pnpm typecheckcargo test --lib openhuman::config::schema::cloud_providers(4 pass); VitestbuiltinCloudProviders.test.ts+AIPanel.test.tsx(45 pass)cargo fmt --check,cargo check,cargo clippycleanValidation Blocked
None — pushed with the pre-push hook enabled (vendored submodules initialized in the worktree).
Behavior Changes
https://api.minimax.io/v1+ Bearer; model-listing and chat resolve. No change to error handling for any other provider.Parity Contract
Rust catalog and the frontend
builtinCloudProviders.tsmirror are updated together and asserted by tests on both sides.Duplicate / Superseded PR Handling
Supersedes this PR's own earlier approach (a 404-reclassification), which was withdrawn because PR #2959 explicitly reverted that style of Sentry-error suppression. This revision fixes the root-cause misconfiguration instead.
Summary by CodeRabbit
https://api.minimax.io/v1). Replaces previous Anthropic-style endpoint. Improves API standardization and aligns provider integration with modern authentication patterns, ensuring better consistency across the platform's cloud provider ecosystem.