Skip to content

fix: add "google" provider alias for gemini credential detection and routing#137

Merged
l50 merged 1 commit into
mainfrom
google-provider-alias
Jul 2, 2026
Merged

fix: add "google" provider alias for gemini credential detection and routing#137
l50 merged 1 commit into
mainfrom
google-provider-alias

Conversation

@l50

@l50 l50 commented Jul 2, 2026

Copy link
Copy Markdown
Member

Key Changes:

  • normalizeProvider now maps the "google" provider name to "gemini", preventing runtime failures when agent manifests use "google" to reference Gemini models
  • Credential detection in providerAPIKeyEnv now includes "google" mapped to GOOGLE_API_KEY, preventing fallback selection from incorrectly treating "google" as a keyless provider
  • Tests added to pin both the alias behavior and credential lookup for the "google" provider spelling

Added:

  • Provider alias test - Added runner/model_provider_test.go with TestNormalizeProviderGoogleAlias to pin the "google" → "gemini" normalization across casing and whitespace variants, guarding against regressions that would cause buildLLM to fail with "provider not implemented: google"
  • "google" credential entry - Added "google": {"GOOGLE_API_KEY"} to providerAPIKeyEnv in metrics/apikey.go with a test case in metrics/apikey_test.go, ensuring fallback selection correctly requires GOOGLE_API_KEY to be present before picking a google-provider manifest entry

Changed:

  • Provider normalization logic - Extended normalizeProvider in runner/model.go to alias "google" to "gemini" after lowercasing and trimming, so both buildLLM dispatch and telemetry treat the two spellings identically regardless of how agent manifests spell the provider name

**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

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@l50 l50 merged commit efed1a4 into main Jul 2, 2026
5 checks passed
@l50 l50 deleted the google-provider-alias branch July 2, 2026 21:28
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