Description:
Currently validate_env_vars() and check_required_vars() in app/utils/config.py only print warnings when NCBI_API_KEY, EMAIL, or LLM keys are missing. The app still starts, which leads to runtime errors and confusing health/analysis failures.
Acceptance criteria:
- When
ENVIRONMENT=production (or a dedicated STRICT_ENV=true), the application exits with a non-zero code at startup if any of the required vars are missing: NCBI_API_KEY, EMAIL, and at least one LLM key (e.g. GEMINI_API_KEY).
- Log a clear message listing the missing variables and how to set them (e.g.
.env or export).
- In development (default or
ENVIRONMENT=development), keep current behavior (warn but do not exit).
Files to consider: app/utils/config.py, main.py, Docker CMD/entrypoint.
Description:
Currently
validate_env_vars()andcheck_required_vars()inapp/utils/config.pyonly print warnings whenNCBI_API_KEY,EMAIL, or LLM keys are missing. The app still starts, which leads to runtime errors and confusing health/analysis failures.Acceptance criteria:
ENVIRONMENT=production(or a dedicatedSTRICT_ENV=true), the application exits with a non-zero code at startup if any of the required vars are missing:NCBI_API_KEY,EMAIL, and at least one LLM key (e.g.GEMINI_API_KEY)..envor export).ENVIRONMENT=development), keep current behavior (warn but do not exit).Files to consider:
app/utils/config.py,main.py, DockerCMD/entrypoint.