Skip to content

feat(cli): add "step config check" to report keys and values this build ignores - #371

Merged
liuedcson merged 1 commit into
mainfrom
feat/config-check
Nov 26, 2026
Merged

liuedcson merged 1 commit into
mainfrom
feat/config-check

Conversation

@liuedcson

@liuedcson liuedcson commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

What

step config check [--json] [--allow-unknown] validates the global and project
config.toml plus models.json against 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.

$ step config check
~/.stepcode/config.toml:compaction.triggerRation: this build (0.1.0) does not read "triggerRation", so the setting has no effect; did you mean "triggerRatio"?
~/.stepcode/config.toml:search.provider: must be one of: "auto", "off", "step", "exa", "firecrawl", "parallel", "tavily", "tinyfish"

--allow-unknown reports an unknown key without failing, for a configuration
shared with a newer release whose keys this build does not know yet. A rejected
value still fails. --json returns {ok, checkedFiles, notes, problems} with
kind: unknown | invalid | parse per 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 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.

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 whose
child already failed, so packages = [{ source: 1 }] points at source and does
not 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.toml that the runtime
only loads when the project is trusted, and a global file missing the
#:schema line, are both reported as notes.

Validation

  • pnpm run check passes.
  • ./test.sh passes: 5671 passed / 59 skipped in packages/coding-agent, 762 in
    apps/cli, no failures in any package.

Base

#370, which added the schema this validates against, is already merged. The
branch is rebuilt on main and adds only config-check.ts and the command
wiring.

Base automatically changed from feat/config-schema to main November 26, 2026 13:20
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
liuedcson merged commit 437f1c1 into main Nov 26, 2026
2 checks passed
@liuedcson
liuedcson deleted the feat/config-check branch November 26, 2026 13:36
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