fix: add "google" provider alias for gemini credential detection and routing#137
Merged
Conversation
**Added:** - `"google"` entry in `providerAPIKeyEnv` mapping it to `GOOGLE_API_KEY`, preventing unknown-provider fallback when `GOOGLE_API_KEY` is absent - `metrics/apikey.go` - Test case for `"google"` provider in `TestKeyStatusProviderEnvTable` to verify credential detection parity with `"gemini"` - `metrics/apikey_test.go` - `TestNormalizeProviderGoogleAlias` test pinning the `"google"` → `"gemini"` alias behavior, including whitespace and mixed-case variants - `runner/model_provider_test.go` **Changed:** - `normalizeProvider` now maps `"google"` to `"gemini"` so agent manifests using the `"google"` spelling route correctly to `buildLLM` and telemetry without hitting "provider not implemented: google" - `runner/model.go`
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes:
normalizeProvidernow maps the "google" provider name to "gemini", preventing runtime failures when agent manifests use "google" to reference Gemini modelsproviderAPIKeyEnvnow includes "google" mapped toGOOGLE_API_KEY, preventing fallback selection from incorrectly treating "google" as a keyless providerAdded:
runner/model_provider_test.gowithTestNormalizeProviderGoogleAliasto pin the "google" → "gemini" normalization across casing and whitespace variants, guarding against regressions that would causebuildLLMto fail with "provider not implemented: google""google"credential entry - Added"google": {"GOOGLE_API_KEY"}toproviderAPIKeyEnvinmetrics/apikey.gowith a test case inmetrics/apikey_test.go, ensuring fallback selection correctly requiresGOOGLE_API_KEYto be present before picking a google-provider manifest entryChanged:
normalizeProviderinrunner/model.goto alias"google"to"gemini"after lowercasing and trimming, so bothbuildLLMdispatch and telemetry treat the two spellings identically regardless of how agent manifests spell the provider name