Skip to content

fix: add Antigravity 'invalid argument' fallback + NVIDIA Minimax model family - #4926

Closed
KooshaPari wants to merge 1 commit into
diegosouzapw:mainfrom
KooshaPari:upstream-pr/antigravity-nvidia-fallback-2026-06-24
Closed

KooshaPari wants to merge 1 commit into
diegosouzapw:mainfrom
KooshaPari:upstream-pr/antigravity-nvidia-fallback-2026-06-24

Conversation

@KooshaPari

Copy link
Copy Markdown
Contributor

Summary

Cherry-picks a small, focused fix from the KooshaPari fork that broadens provider model-unavailable detection and adds a NVIDIA Minimax model family. The change is purely additive — no existing logic is altered, and all behaviour is gated on the existing isModelUnavailableError() matcher plus the MODEL_FAMILIES lookup table.

Why it matters

  • Antigravity 400 fallback: Antigravity (an OpenAI-compatible provider) returns a 400 with body text invalid argument when claude-opus-4-6-thinking is not available on the current account. Without this fragment, the request fails hard instead of falling back to claude-opus-4-6 or claude-opus-4-5-20251101.
  • NVIDIA Minimax model family: Adds cross-model fallback for minimaxai/minimax-m2.7 ↔ minimaxai/minimax-m2.5 when one returns 404 Function not found.

Files

M  open-sse/services/modelFamilyFallback.ts

Diff

@@ -87,6 +87,10 @@ const MODEL_FAMILIES: Record<string, string[]> = {
   "claude-sonnet-4-6": ["claude-sonnet-4-5-20250929", "claude-sonnet-4-20250514"],
   "claude-sonnet-4-5-20250929": ["claude-sonnet-4-6", "claude-sonnet-4-20250514"],
 
+  // NVIDIA Minimax family
+  "minimaxai/minimax-m2.7": ["minimaxai/minimax-m2.5", "minimax-m2.7", "minimax-m2.5"],
+  "minimaxai/minimax-m2.5": ["minimaxai/minimax-m2.7", "minimax-m2.5", "minimax-m2.7"],
+
   // GPT-5 family
   "gpt-5": ["gpt-5-mini", "gpt-4o"],
@@ -113,6 +117,7 @@ const MODEL_UNAVAILABLE_FRAGMENTS = [
   "not enabled for",
   "access to model",
   "improperly formed request", // Kiro 400 (model unavailable)
+  "invalid argument", // Antigravity 400 (model unavailable)
 ];

Compatibility

  • No breaking changes — strictly additive. Defaults to existing model-resolution path if neither new fragment nor new family is matched.
  • Behaviour parity — Antigravity 400 errors and NVIDIA Minimax 404s now route through the same isModelUnavailableError() path as every other provider.
  • No new deps — uses only the existing MODEL_FAMILIES table and MODEL_UNAVAILABLE_FRAGMENTS array.

Test plan

  • Existing test suite for modelFamilyFallback.ts should pass unchanged.
  • Manual: trigger a 400 with body invalid argument on claude-opus-4-6-thinking and verify fallback to claude-opus-4-6.
  • Manual: trigger a 404 on minimaxai/minimax-m2.7 and verify fallback to minimaxai/minimax-m2.5.

Refs

…el family (#1)

- Add 'invalid argument' to MODEL_UNAVAILABLE_FRAGMENTS so Antigravity 400
  errors on claude-opus-4-6-thinking trigger automatic fallback to
  claude-opus-4-6 or claude-opus-4-5-20251101
- Add NVIDIA Minimax model family for cross-model fallback when minimax-m2.7
  or minimax-m2.5 returns model-unavailable errors (404 Function not found)

(cherry picked from commit bc62557)
@KooshaPari
KooshaPari requested a review from diegosouzapw as a code owner June 24, 2026 10:14

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds fallback mappings for the NVIDIA Minimax model family and registers 'invalid argument' as a model unavailable fragment in open-sse/services/modelFamilyFallback.ts. The review feedback identifies a correctness issue where the Minimax family keys and candidates are defined with provider prefixes (e.g., minimaxai/). Since the fallback system expects bare model names, this prefixing will cause lookup failures and duplicate prefixes. A suggestion is provided to use bare model names instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +90 to +92
// NVIDIA Minimax family
"minimaxai/minimax-m2.7": ["minimaxai/minimax-m2.5", "minimax-m2.7", "minimax-m2.5"],
"minimaxai/minimax-m2.5": ["minimaxai/minimax-m2.7", "minimax-m2.5", "minimax-m2.7"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

There is a correctness issue with how the Minimax family is defined here. In this codebase, MODEL_FAMILIES keys and candidates must be bare model names (without the provider prefix like minimaxai/).

Why this is broken:

  1. Lookup Failure: When a request fails, getNextFamilyFallback calls parseModel(currentModel) which extracts the bare model name (e.g., "minimax-m2.7"). It then looks up MODEL_FAMILIES using the bare model name or its hyphenated version ("minimax-m2-7"). Since your keys are prefixed with "minimaxai/", the lookup will return undefined and the fallback will never trigger.
  2. Helper Failures: isInModelFamily and getModelFamily also perform lookups using the bare model name, meaning they will fail to recognize Minimax models as belonging to any family.
  3. Prefix Duplication: Even if the lookup succeeded, getNextFamilyFallback automatically prepends the provider prefix to the candidate. If the candidate is "minimaxai/minimax-m2.5", the resolved fallback model would incorrectly become "minimaxai/minimaxai/minimax-m2.5".

Solution:

Define the keys and candidates using only the bare model names, matching the pattern used by all other families (Gemini, Claude, GPT-5) in this file.

Suggested change
// NVIDIA Minimax family
"minimaxai/minimax-m2.7": ["minimaxai/minimax-m2.5", "minimax-m2.7", "minimax-m2.5"],
"minimaxai/minimax-m2.5": ["minimaxai/minimax-m2.7", "minimax-m2.5", "minimax-m2.7"],
// NVIDIA Minimax family
"minimax-m2.7": ["minimax-m2.5"],
"minimax-m2.5": ["minimax-m2.7"],

@KooshaPari

Copy link
Copy Markdown
Contributor Author

Closing — audit against upstream v3.8.36 @ a9ddef1 shows 0 NEW files in this PR's diff vs the current tip (all files already exist upstream). No second implementation needed; tracking continues on the unique-value PRs (#4777, #4778, #4979).

@KooshaPari KooshaPari closed this Jun 25, 2026
@KooshaPari
KooshaPari deleted the upstream-pr/antigravity-nvidia-fallback-2026-06-24 branch August 13, 2026 06:55
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