Skip to content

fix(ai): add MiniMax regional endpoint metadata - #498

Open
octo-patch wants to merge 4 commits into
TabularisDB:mainfrom
octo-patch:codex/minimax-cn-endpoints
Open

fix(ai): add MiniMax regional endpoint metadata#498
octo-patch wants to merge 4 commits into
TabularisDB:mainfrom
octo-patch:codex/minimax-cn-endpoints

Conversation

@octo-patch

Copy link
Copy Markdown
Contributor

Summary

  • define current MiniMax OpenAI- and Anthropic-compatible endpoints for global and cn_zh regions
  • try both official regional model-list endpoints so mainland China API keys are supported
  • cover endpoint metadata and retain MiniMax M3/M2.7 defaults in tests

Testing

  • git diff --check
  • Rust tests could not run in the worker environment because cargo is not installed

@kilo-code-bot

kilo-code-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src-tauri/src/ai.rs
Previous Review Summary (commit 99e99f0)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 99e99f0)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src-tauri/src/ai.rs

Reviewed by ling-3.0-flash:free · Input: 336.6K · Output: 27.4K · Cached: 2.2M

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I checked out the branch, ran the tests and probed the endpoints directly, and the model-list part works as advertised: both /v1/models URLs are live and return 401 on a wrong-region key, so the fallback loop does what it should. A CN key that previously got nothing will now populate the model dropdown. ai::tests passes on the branch and cargo check is clean.

The problem is that the fix stops halfway. generate_minimax (line ~988) still posts to a hardcoded https://api.minimax.io/v1/chat/completions, so a mainland-China key now sees its models listed but every actual generation fails with a 401. That's arguably worse than before, because the feature looks configured and then breaks the moment you use it. Could you route the chat call through the same regional endpoints? Ideally remember which region the models call succeeded on rather than retrying both on every request.

Two smaller things, both of which probably resolve themselves once the above is done:

  • region and anthropic_base_url are never read at runtime. The only warning keeping them "alive" is suppressed by derive(Debug). If the chat call starts using the endpoint table, fine; otherwise they should go.
  • test_minimax_endpoint_metadata just re-asserts the constants' own values, so it can't catch any regression that matters. Once the endpoints are actually exercised by generate_minimax, a test around the fallback selection would pull more weight.

Requesting changes for the generate_minimax gap, since "mainland China API keys are supported" is the stated goal of the PR and generation is the part users actually notice.

@debba

debba commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

@octo-patch are you able to check them?

@octo-patch

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I routed generate_minimax through the regional endpoint table, made model discovery and generation remember the last successful region while retaining fallback, and replaced the unused metadata assertion with endpoint-order coverage. The repository test job and automated code review both pass on the new commit.

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.

3 participants