fix: validate config enum values from YAML + add 13 config tests - #164
Open
TerminalGravity wants to merge 1 commit into
Open
fix: validate config enum values from YAML + add 13 config tests#164TerminalGravity wants to merge 1 commit into
TerminalGravity wants to merge 1 commit into
Conversation
…fig tests - Profile, embedding provider, and triage strictness values from .preflight/*.yml are now validated against allowed enums - Invalid values log a warning and fall back to defaults instead of silently accepting arbitrary strings - Add resetConfig() export for test isolation - Add 13 unit tests covering defaults, env vars, YAML loading, validation warnings, caching, and error handling
TerminalGravity
commented
Mar 10, 2026
TerminalGravity
left a comment
Collaborator
Author
There was a problem hiding this comment.
Solid defensive fix. Silent config corruption from typos is exactly the kind of thing that wastes hours debugging — "why isn't my profile working?" turns out to be profile: ful instead of profile: full.
The fallback-to-defaults approach is the right call over throwing — config errors shouldn't crash the MCP server. Warning + default keeps things running while surfacing the issue.
13 tests for the config module is good coverage. LGTM.
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.
Problem: Config values from
.preflight/config.ymlandtriage.ymlwere accepted without validation — settingprofile: "turbo"orstrictness: "extreme"would silently corrupt config state.Fix:
profile,embeddings.provider, andtriage.strictnessagainst allowed enumsresetConfig()for test isolationTests: 13 new unit tests covering defaults, env vars, YAML loading, validation warnings, caching, and error handling. All 56 tests pass.