Skip to content

Fix MiniMax fallback routing - #84

Closed
Marenz wants to merge 2 commits into
spacedriveapp:mainfrom
Marenz:pr/fix-oauth-minimax
Closed

Fix MiniMax fallback routing#84
Marenz wants to merge 2 commits into
spacedriveapp:mainfrom
Marenz:pr/fix-oauth-minimax

Conversation

@Marenz

@Marenz Marenz commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

MiniMax was configured as ApiType::Anthropic with base_url: api.minimax.io/anthropic, but build_anthropic_request hardcodes api.anthropic.com/v1/messages. MiniMax requests were sent to Anthropic's API with a MiniMax key, producing invalid x-api-key.

Fix: switch MiniMax to ApiType::OpenAiCompletions with base_url: api.minimax.io — their OpenAI-compatible endpoint works correctly.

Also upgrades the empty-response log from debug! to warn! for better observability.

Fixes #147

@Marenz
Marenz force-pushed the pr/fix-oauth-minimax branch 2 times, most recently from 28e9916 to 908bbb7 Compare February 21, 2026 01:24
@Marenz
Marenz force-pushed the pr/fix-oauth-minimax branch from 908bbb7 to 65093c5 Compare February 21, 2026 10:35
@Marenz Marenz changed the title Fix OAuth auth and MiniMax fallback routing Fix MiniMax fallback routing Feb 21, 2026
@Marenz

Marenz commented Feb 21, 2026

Copy link
Copy Markdown
Collaborator Author

Dropped the OAuth workaround commit — #100 solves that more cleanly at the LlmManager level. This PR now only contains the MiniMax routing fix and the warn-level log upgrade.

MiniMax was configured as ApiType::Anthropic, but build_anthropic_request
hardcodes api.anthropic.com. Requests were sent to Anthropic with a
MiniMax key, producing 401 invalid x-api-key.

Switch to ApiType::OpenAiCompletions with base_url api.minimax.io —
their OpenAI-compatible endpoint works correctly.
The debug log for empty assistant_content was invisible at default log
level. Upgrade to warn so we can see stop_reason and raw content when
the API returns an empty content array.
@Marenz

Marenz commented Feb 23, 2026

Copy link
Copy Markdown
Collaborator Author

While this PR was open, the Anthropic path was fixed to correctly use base_url instead of a hardcoded URL. Tested locally: MiniMax via ApiType::Anthropic + https://api.minimax.io/anthropic works correctly. Closing as no longer needed.

@Marenz Marenz closed this Feb 23, 2026
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.

MiniMax Coding Plan integration fails with 401 Unauthorized

1 participant