Skip to content

fix(index): use GEMINI_API_KEY for google provider startup validation#63

Open
Nivesh353 wants to merge 1 commit into
open-gitagent:mainfrom
Nivesh353:fix/google-api-key-env-var-mismatch
Open

fix(index): use GEMINI_API_KEY for google provider startup validation#63
Nivesh353 wants to merge 1 commit into
open-gitagent:mainfrom
Nivesh353:fix/google-api-key-env-var-mismatch

Conversation

@Nivesh353

Copy link
Copy Markdown
Contributor

Problem

The startup validation in index.ts checked GOOGLE_API_KEY for the
google: provider, but pi-ai's env-api-keys.js uses GEMINI_API_KEY
for actual API calls.

This caused two issues:

  • Users setting only GEMINI_API_KEY got a crash at startup:
    Error: GOOGLE_API_KEY environment variable is not set
  • Users had to set both keys to get the google: provider working,
    with no indication that two separate keys were needed

Fix

Changed the startup env var check for the google: provider from
GOOGLE_API_KEY to GEMINI_API_KEY, aligning with what pi-ai uses
for authentication.

Impact

  • One-line change in index.ts
  • Users now only need GEMINI_API_KEY for the google: provider
  • No functional change to API behavior — only the startup guard is updated

@shreyas-lyzr shreyas-lyzr 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.

The fix is correct. The rest of the codebase — line 430 in index.ts, Documentation.md (the provider table and env var reference) — all consistently use GEMINI_API_KEY for the google provider. The startup guard was the only outlier, and this one-line change brings it into alignment. No issues found.

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.

2 participants