Skip to content

[WIP] Fix GEMINI_API_KEY validation in config loading - #28

Draft
mdvnavy with Codex wants to merge 2 commits into
mainfrom
codex/fix-gemini-api-key-validation
Draft

[WIP] Fix GEMINI_API_KEY validation in config loading#28
mdvnavy with Codex wants to merge 2 commits into
mainfrom
codex/fix-gemini-api-key-validation

Conversation

@Codex

@Codex Codex AI commented Jul 5, 2026

Copy link
Copy Markdown

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>config: GEMINI_API_KEY validation couples unrelated features (OBS, Jules) to Gemini</issue_title>
<issue_description>## 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</issue_description>

Comments on the Issue (you are @codex[agent] in this section)

@Codex
Codex AI requested a review from mdvnavy July 5, 2026 23:16
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.

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

2 participants