Skip to content

feat(#30): add centralized env validation at startup - #62

Open
atbrace wants to merge 1 commit into
mainfrom
30-env-validation
Open

feat(#30): add centralized env validation at startup#62
atbrace wants to merge 1 commit into
mainfrom
30-env-validation

Conversation

@atbrace

@atbrace atbrace commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added src/lib/env.ts with validateLLMEnv() for early startup validation
  • Created src/instrumentation.ts (Next.js register hook) to validate on server start
  • Enabled instrumentationHook in next.config.js
  • Refactored getProvider() to reuse shared validation logic

Closes #30

Test plan

  • Missing API key prints clear error at startup (not on first API call)
  • Existing provider tests pass
  • pnpm test:run passes

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Centralized env validation at startup

1 participant