Repository navigation
feat(cli): add "step config check" to report keys and values this build ignores - #371
Merged
Merged
Conversation
liuedcson
requested review from
MelodyVAR,
Uking-xxx and
ZouR-Ma
as code owners
November 26, 2026 13:12
The schema from the previous commit describes the accepted keys, but nothing told a user whether the file they wrote matches it. The runtime is forgiving by design: an unknown key is carried along and never read, a malformed value falls back to its default, and an unrecognized enum falls back silently. All three look the same from the outside — the file says one thing and the session does another. `step config check [--json] [--allow-unknown]` validates the global and project `config.toml` plus `models.json` and lists every problem. Anything it reports fails the check, including an unknown key: the key is kept but never read, so the setting does nothing. `--allow-unknown` reports those without failing, for a config shared with a newer release whose keys this build does not know. The file is validated as written, not after the load path's legacy rewrites. Migrating first reported paths the user cannot find — a bad `queueMode` came back as `/steeringMode` — and values the rewrite drops, such as `retry.maxDelayMs = "abc"`, disappeared from the report entirely. The legacy keys are in the schema instead, so a file that uses one is valid and a malformed one is still visible. A union produces one failure per member; the report groups them into one message per field (`must be a boolean or "auto"`) and stays quiet about a parent whose child already failed, so a valid object with one bad field is not also called invalid. TypeBox stops collecting after eight errors by default, which would make a longer file look like it had eight. The limit is raised for the duration of one validation and restored afterwards, so the process-wide setting other callers see is unchanged.
liuedcson
force-pushed
the
feat/config-check
branch
from
November 26, 2026 13:24
09be4e1 to
dae708e
Compare
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
step config check [--json] [--allow-unknown]validates the global and projectconfig.tomlplusmodels.jsonagainst the schema shipped by the same build,and lists every problem.
Why
The previous PR makes the accepted keys machine-readable. This one answers the
other half of the reported problem: "I configured it, why did nothing change?"
The runtime is forgiving by design — an unknown key is carried along and never
read, a malformed value falls back to its default, an unrecognized enum falls
back silently. All three look the same from the outside, so a user has no way to
tell "this key is wrong" from "this key does nothing here".
Behavior
Anything reported fails the check, including an unknown key. The runtime
keeps such a key but never reads it, so the setting does nothing; that is exactly
the case this command exists to make visible.
--allow-unknownreports an unknown key without failing, for a configurationshared with a newer release whose keys this build does not know yet. A rejected
value still fails.
--jsonreturns{ok, checkedFiles, notes, problems}withkind: unknown | invalid | parseper problem, so CI can filter on it.Validated as written, not after the load path's rewrites. Migrating first
reported paths the user cannot find — a bad
queueModecame back as/steeringMode— and values the rewrite drops, such asretry.maxDelayMs = "abc", disappeared from the report entirely. The legacy keysare in the schema instead, so a file that uses one is valid and a malformed one
is still visible.
One message per field. A union produces one failure per member. The report
groups them (
must be a boolean or "auto") and stays quiet about a parent whosechild already failed, so
packages = [{ source: 1 }]points atsourceand doesnot also call the entry invalid.
TypeBox stops collecting after eight errors by default, which would make a
longer file look like it had eight. The limit is raised for one validation and
restored afterwards, so the process-wide setting other callers see is unchanged.
Notes do not affect the exit code. A project
config.tomlthat the runtimeonly loads when the project is trusted, and a global file missing the
#:schemaline, are both reported as notes.Validation
pnpm run checkpasses../test.shpasses: 5671 passed / 59 skipped inpackages/coding-agent, 762 inapps/cli, no failures in any package.Base
#370, which added the schema this validates against, is already merged. The
branch is rebuilt on
mainand adds onlyconfig-check.tsand the commandwiring.