Skip to content

config: GEMINI_API_KEY validation couples unrelated features (OBS, Jules) to Gemini #27

Description

@mdvnavy

Location

client_discovery/config.pyload_and_validate_config() (~line 37)

Problem

load_and_validate_config() hard-requires GEMINI_API_KEY whenever TESTING != "true":

if not gemini_api_key:
    if testing:
        logger.warning(...)
    else:
        raise ValueError("GEMINI_API_KEY is required but missing from the environment.")

This couples unrelated features to the Gemini key. _resolve_obs_credentials() and refine_with_jules() both call load_config(), so enabling OBS_CAPTURE or Jules refinement without a Gemini key will raise and break otherwise-deterministic flows.

Fix

Split config loading from feature-specific validation. Load env vars centrally; only validate the Gemini key on the agent/strategic-analysis code path (where it's actually needed), not for OBS capture or Jules.

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

Labels

archArchitecture / refactor

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions