Repository navigation
test(config): pin the accepted configuration surface - #373
Merged
Merged
Conversation
The schema is generated from the TypeBox definitions, so deleting a field there removes it from the schema in the same commit and `check:config-schema` still passes. That makes an accidental removal look like an intentional one: replacing `model-config.ts` during a branch sync once dropped a branch-specific field, and nothing failed until the generated schema was compared by hand. Three guards, each verified by deleting a field and watching it fail: - the field lists for `provider`, `model` and `modelOverride` in `models.json` are written down independently of the schema; - the hand-written `StepMcpServerConfig` interface may not declare a field the schema lacks; - every top-level key a loader reads through `document.` has to be in the schema. The lists describe what this build accepts. A branch that adds a field extends them there, so a sync that drops the field fails in the branch that owns it rather than here.
liuedcson
requested review from
MelodyVAR,
Uking-xxx and
ZouR-Ma
as code owners
November 27, 2026 02:57
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.
What
Three tests that pin the accepted configuration surface, so a field cannot
disappear from the schema by accident.
Why
check:config-schemacompares the generated files against the definitions theyare generated from. That catches a schema that was forgotten, but not a field
that was deleted: the schema is rendered from the same TypeBox objects, so
removing a field there removes it from the schema in the same commit and the
check still passes.
That gap has already cost something. Replacing
model-config.tswhile syncing abranch that carries extra fields silently dropped one of them, and the only
thing that noticed was a person reading the generated diff.
What the guards check
models.jsonfield lists.provider,modelandmodelOverridearewritten down independently of the schema and compared against what the
generated schema contains.
StepMcpServerConfigis declared next to theloader, not derived from the schema. Every field it declares has to exist in
the schema, or the editor rejects a server the loader accepts.
readGlobalStepDefaults, the search tool and MCP discoveryread the config document by name rather than through the settings schema.
Every
document.<key>a loader reads has to be a top-level key.Each guard was verified by deleting a field and confirming the test fails:
removing
samplingParamsreportsexpected [...9] to deeply equal [...10].Scope
The lists describe what this build accepts. A branch with extra fields extends
its own lists, which is the point: a sync that drops one of those fields fails
in the branch that owns it, not after it lands.
Validation
pnpm run checkpasses../test.shpasses: 5675 passed / 59 skipped inpackages/coding-agent, 762 inapps/cli, no failures in any package.