fix: exit with clear error on missing required env vars #195

Closed
pook wants to merge 2 commits from fix/env-var-validation into main
Owner

Summary

  • Adds startup validation for OPENAI_API_KEY and DATABASE_URL env vars
  • App exits with FATAL: Missing required environment variable: <name> if either is absent
  • Extracted into testable env-check module with 5 unit tests (all passing)

Closes #114 (refs #142, #190 as duplicates)

Test plan

  • bun test src/env-check.test.ts — 5/5 pass
  • Manual: start API without OPENAI_API_KEY → verify exit with clear message
  • Manual: start API without DATABASE_URL → verify exit with clear message
  • Manual: start API with both set → verify normal startup

🤖 Generated with Claude Code

## Summary - Adds startup validation for `OPENAI_API_KEY` and `DATABASE_URL` env vars - App exits with `FATAL: Missing required environment variable: <name>` if either is absent - Extracted into testable `env-check` module with 5 unit tests (all passing) Closes #114 (refs #142, #190 as duplicates) ## Test plan - [x] `bun test src/env-check.test.ts` — 5/5 pass - [ ] Manual: start API without `OPENAI_API_KEY` → verify exit with clear message - [ ] Manual: start API without `DATABASE_URL` → verify exit with clear message - [ ] Manual: start API with both set → verify normal startup 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Validates required env vars at startup before server initialization.
Extracted into testable env-check module with full unit test coverage.

Closes #114 (refs #142, #190 as duplicates)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Owner

Closed 2026-04-10 during pipeline triage.

Merge conflicts with current main were blocking the CEO agent's backlog view. Reopen / resubmit against current main if the work is still relevant — CEO now injects open issues/PRs into its prompt and avoids duplicating.

Closed 2026-04-10 during pipeline triage. Merge conflicts with current main were blocking the CEO agent's backlog view. Reopen / resubmit against current main if the work is still relevant — CEO now injects open issues/PRs into its prompt and avoids duplicating.
pook closed this pull request 2026-04-10 15:06:06 -04:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot!195
No description provided.