Skip to content

feat(minimax): auto-detect CN/global endpoint and region label#1

Closed
FrankieeW wants to merge 2 commits intomainfrom
feat-minimax-endpoint-selection
Closed

feat(minimax): auto-detect CN/global endpoint and region label#1
FrankieeW wants to merge 2 commits intomainfrom
feat-minimax-endpoint-selection

Conversation

@FrankieeW
Copy link
Owner

Description

Adds MiniMax region auto-detection and improves CN usability without manual endpoint config.

  • Removes manual endpoint env selection.
  • Auto-detects region using available keys:
    • with MINIMAX_CN_API_KEY: tries CN -> GLOBAL
    • without MINIMAX_CN_API_KEY: tries GLOBAL -> CN
  • Uses CN key precedence in CN path (MINIMAX_CN_API_KEY first).
  • Adds visible session label by selected region: Session (CN) / Session (GLOBAL).
  • Updates Tauri host env allowlist for required MiniMax vars.
  • Updates MiniMax docs and tests to match final behavior.

Related Issue

N/A

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (describe below)

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass
  • I tested the change locally with bun tauri dev

Additional validation:

  • bun run test -- plugins/minimax/plugin.test.js (pass)
  • bun run test:coverage was executed; suite passed, but repo-level coverage thresholds currently fail in pre-existing unrelated files.

Screenshots

Verified locally with screenshot showing MiniMax Session (CN) and live usage values.

Checklist

  • I read CONTRIBUTING.md
  • My PR targets the main branch
  • I did not introduce new dependencies without justification

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba1c2be45a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


const line = {
label: "Session",
label: resolvedEndpoint ? "Session (" + resolvedEndpoint + ")" : "Session",

Choose a reason for hiding this comment

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

P1 Badge Keep MiniMax progress label stable across regions

Changing the emitted label to Session (CN)/Session (GLOBAL) breaks downstream matching because the manifest still declares Session as the primary overview line (plugins/minimax/plugin.json:10), and both overview filtering and tray primary selection use exact label equality (src/components/provider-card.tsx:174-184, src/lib/tray-primary-progress.ts:65-71). In those contexts, MiniMax usage data is produced but not recognized, so users can see missing overview progress and --% tray output.

Useful? React with 👍 / 👎.

}
lastError = "Could not parse usage data."
} catch (e) {
lastError = String(e)

Choose a reason for hiding this comment

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

P2 Badge Preserve non-auth errors across AUTO endpoint retries

This assignment unconditionally replaces prior attempt failures with the last endpoint’s error, so AUTO mode can misreport outages as credential problems. For example, if GLOBAL returns a real server failure (Request failed (HTTP 500) from line 319) and the CN retry returns auth, the final error becomes Session expired, which sends users to rotate keys instead of treating it as service unavailability. Keep the higher-signal non-auth failure when later retries only add auth noise.

Useful? React with 👍 / 👎.

@FrankieeW
Copy link
Owner Author

Closing this fork PR in favor of upstream PR: robinebers#230

@FrankieeW FrankieeW closed this Feb 24, 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.

1 participant