Skip to content

service: misconfig check only tests GEMINI_API_KEY, ignores GOOGLE_API_KEY #25

Description

@mdvnavy

Location

client_discovery/service.pybuild_intake_response() (~line 30-32)

Problem

gemini_api_key = os.environ.get("GEMINI_API_KEY")
if not gemini_api_key:
    strategic_analysis = "DIA Agent Error: GEMINI_API_KEY is missing or invalid."

This path only checks GEMINI_API_KEY, but the rest of the codebase (e.g. app.py / agent_runtime.py / character.py) treats either GEMINI_API_KEY or GOOGLE_API_KEY as valid configuration. If GOOGLE_API_KEY is set (and GEMINI_API_KEY is not), this will incorrectly report the agent as misconfigured and return the error string instead of running the agent.

Fix

Check both keys, e.g.:

api_key = os.environ.get("GEMINI_API_KEY") or os.environ.get("GOOGLE_API_KEY")
if not api_key:
    strategic_analysis = "DIA Agent Error: GEMINI_API_KEY/GOOGLE_API_KEY is missing or invalid."

Source

Originally raised in review of PR #21 (now docs-only): outdated thread PRRT_kwDOSzLAqc6JYBhz. Confirmed still present on main.

/tracked-issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions