Repository navigation
fix: import google-genai providers from custom registries - #4735
Conversation
🦋 Changeset detectedLatest commit: d4433e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@codex review |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Requirement or Bug
Custom registries that publish a
google-genaiprovider were silently dropped on import. A document containing only that provider failed with "has no importable providers".Bug Reproduction Steps
api.jsonwhose only provider has"type": "google-genai"and"api": "https://gateway.example.test/v1beta"./providerorkimi provider.Root Cause
The registry parser accepted only
anthropic,openai,openai_responses, andkimi, even though the engine already implementsgoogle-genai. Allowing the type alone was not enough:@google/genaiappends its default API version tobaseUrl, so an endpoint that already ends in/v1betawould be requested at/v1beta/v1beta/.... This strips that trailing version before constructing the client.Code Changes
fetchCustomRegistrynow keepsgoogle-genaientries, and the Gemini client strips a trailing/v1beta(or/v1beta1on the Vertex path) frombaseUrlbefore handing it to the SDK. The SDK still appends the version itself, so both a host root and a versioned registry URL resolve to the same request path.vertexairemains outside the registry allowlist. The credential is still sent asx-goog-api-key.Behavior Changes and Affected Users
api.jsonentry withtype: google-genaigoogle-genaiprovidergoogle-genaibase_urlending in/v1beta/v1beta/v1beta/.../v1betakeep working; configs that included it and depended on the doubled path stop hitting that pathbase_urlto the previous doubled path if a gateway actually serves itbase_urlending in/v1beta1/v1beta1/v1beta1/...Affected modules: custom-registry import (
packages/oauth) and the Gemini protocol client (packages/agent-core-v2). Covered by the registry parser test and the client base-URL cases. A live import of a versioned Gemini registry endpoint returned a model response through the patched client.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.