Skip to content

[Fix] Clamp Gemini 4 Argon limits to Google's values on Vercel AI Gateway - #2073

Open
zoomote[bot] wants to merge 1 commit into
mainfrom
feat/gemini-4-argon-2dha6g2aub37r
Open

zoomote[bot] wants to merge 1 commit into
mainfrom
feat/gemini-4-argon-2dha6g2aub37r

Conversation

@zoomote

@zoomote zoomote Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

​Opened on behalf of Toray Altas. Follow up by mentioning @roomote, in the web UI, or in Discord.

Related GitHub Issue

No linked issue. Follow-up to the merged #2043, requested by a maintainer (Toray Altas) via Discord: re-audit provider catalogs for Gemini 4 Argon and fix any wrong metadata.

Description

The Vercel AI Gateway catalog now lists google/gemini-4-argon, but reports context_window: 1,000,000 and max_tokens: 1,000,000. Google's authoritative limits are a shared 1,048,576-token window (input + thinking + output) and a 65,536-token single-request output cap, with longer decodes handled through continuation tokens.

This PR adds a per-model override in parseVercelAiGatewayModel (src/api/providers/fetchers/vercel-ai-gateway.ts) for google/gemini-4-argon, following the existing per-model override pattern used for openai/gpt-6-astra and others:

  • contextWindow: 1,048,576 and maxTokens: 65,536 (Google's documented values, not the gateway's).
  • supportsReasoningEffort: low, medium, high, with default medium.
  • supportsTemperature: false (the Google backend ignores temperature/top_p/top_k on this model).

Zoo Gateway inherits the same override because it reuses parseVercelAiGatewayModel.

Provider re-audit results (all checked live):

Provider Live catalog status Change in this PR
Gemini Developer API (ai.google.dev) Listed (Gemini 4, stable; paid tier only) None — registry entry merged in #2043
Vertex AI Listed; locations global, us, eu None — registry entry merged in #2043
Vercel AI Gateway Listed (google/gemini-4-argon); wrong context/max_tokens (1,000,000 each) Per-model override (this PR)
Zoo Gateway Same catalog/parser as Vercel AI Gateway Inherits the override
OpenRouter Listed (google/gemini-4-argon); metadata matches Google's values None — dynamic catalog fetch
Requesty Lists vertex/gemini-4-argon (and @eu) None — dynamic catalog fetch
Unbound No Gemini models in its catalog None

No metadata deltas found for the entries merged in #2043; the registry values still match Google's documentation.

Test Procedure

  • Added a parseVercelAiGatewayModel test in src/api/providers/fetchers/__tests__/vercel-ai-gateway.spec.ts asserting the clamped context window and max tokens, thinking levels, default effort, and supportsTemperature: false for google/gemini-4-argon.
  • Fetcher suites (vercel-ai-gateway.spec.ts, zoo-gateway.spec.ts): 30/30 passed.
  • pnpm run check-types in src: passed. ESLint clean on the touched files.
  • Full pnpm test from the repository root, re-run after rebasing onto current main: 13/13 tasks green; the src suite alone is 539 test files, 10,819 tests passed. (zoo-code#test is intermittently flaky under the parallel turbo run in this environment; standalone and rerun results are green.)

Pre-Submission Checklist

  • Issue Linked: No GitHub issue exists; follow-up requested by a maintainer via Discord (see "Related GitHub Issue").
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I reviewed my own code with care.
  • Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Visual Snapshot (UI changes only): Not applicable. This is a fetcher parser override; no layout, theme token, or rendered-state change. Behavior is covered by Vitest.
  • Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I read and agree to the Contributor Guidelines.

Visual Snapshots

Not applicable: no layout, theme, or rendered-state change.

Videos (interaction / animation only)

Not applicable: no new interaction flow or animation.

Documentation Updates

Additional Notes

Sources: https://cloud.google.com/gemini-enterprise-agent-platform/models/guides/gemini-4-argon and the live Vercel AI Gateway, OpenRouter, and Requesty model catalogs.

Get in Touch

Toray Altas (taltas) on Discord.

@zoomote zoomote Bot assigned taltas Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: Zoo-Code-Org/Zoo-Code/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: cc4182b4-1556-4b22-8a35-3f64ffb13afe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review status

This PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging.

Current step: Required CI passed. Waiting for automated review of the latest commit.

If automated review does not start, a maintainer must restart it.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@zoomote
zoomote Bot force-pushed the feat/gemini-4-argon-2dha6g2aub37r branch from 49792c6 to 565714a Compare October 16, 2026 22:42
@zoomote zoomote Bot changed the title [Feat] Add Gemini 4 Argon to Gemini and Vertex AI providers [Fix] Clamp Gemini 4 Argon limits to Google's values on Vercel AI Gateway Oct 16, 2026
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit coderabbit-review-active Required CI passed; CodeRabbit review is active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants