Skip to content

fix: validate startup config and dotenv examples#62

Merged
arniesaha merged 1 commit intomasterfrom
fix/issue-58
May 6, 2026
Merged

fix: validate startup config and dotenv examples#62
arniesaha merged 1 commit intomasterfrom
fix/issue-58

Conversation

@arniesaha
Copy link
Copy Markdown
Owner

Summary

  • fail fast on invalid or incomplete startup config
  • tighten dotenv example formatting so it can be copied directly
  • add focused validation tests for common bad configs

Why

Mux is infrastructure glue, so silent config drift is worse than a loud startup failure. This makes bad configuration fail early with actionable messages.

Testing

  • npm test -- --run tests/config.validation.test.ts

- Validate startup config; fail fast with clear messages instead of degrading at first request
- Add validation rules: invalid DOWNSTREAM_MODE/AUTH_MODE, missing DOWNSTREAM_API_KEY, malformed PROVIDERS/JSON maps, anthropic-sdk without auth, responses declared without responses-capable provider
- Move throw out of module top-level into exported validateStartupConfig() called from src/server.ts (keeps tests importable without a fully populated env)
- Fix .env.example: every line valid dotenv syntax (prose moved into comments)

Closes #58
@arniesaha arniesaha merged commit f78d683 into master May 6, 2026
1 check passed
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.

1 participant