Validate CLAUDE_MODEL env var against VALID_MODELS at startup#137
Merged
Validate CLAUDE_MODEL env var against VALID_MODELS at startup#137
Conversation
A typo like CLAUDE_MODEL=sonet silently passed through startup and only failed at runtime when the Claude CLI rejected the unknown model. Now raises SystemExit with a clear message, matching the validation already in place for workspace config models. Fixes #130
Owner
Author
Review by KaiPR looks clean. The change is focused, correct, and consistent with existing patterns. No bugs, security issues, or missing error handling found. One minor suggestion: suggestion —
if not claude_model:
raise SystemExit("CLAUDE_MODEL must not be empty")before the Everything else is solid:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLAUDE_MODELenv var againstVALID_MODELSat startup inload_config()CLAUDE_MODEL=sonetnow raisesSystemExitwith a clear message instead of silently passing through to a confusing runtime failureconfig.py:431-440)SystemExitconsistent with other fatal config errors (missing token, bad user IDs, etc.)Test plan
test_invalid_claude_model- typo raisesSystemExitmatching "CLAUDE_MODEL"test_claude_model_from_env- valid model ("opus") is read correctlymake checkcleanFixes #130