Repository navigation
fix(cli): tell config get apart a typo from an unset key - #127369
Conversation
config get answered identically for a real-but-unset schema path and a path that does not exist, and pointed both at config validate, which only reports whether the current file parses. Use the schema runConfigGet already builds to split the two cases: a known path reports that it is unset and offers a runnable config set command for that exact path; an unknown path points at config schema. Exit code stays 1 for both, in text and --json.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 21, 2026, 2:36 PM ET / 18:36 UTC. ClawSweeper reviewWhat this changesThe PR makes Merge readinessKeep open: the new predicate still labels valid nested plugin-schema paths using local Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherThe Config CLI reads operator-authored configuration and an active plugin-derived JSON schema. It prints a redacted stored value when present, otherwise uses the schema to explain whether the requested path is unset or unknown. flowchart LR
A[Operator config-get command] --> B[Parse config path]
B --> C[Read authored config]
C --> D[Build runtime schema]
D --> E{Stored value found?}
E -->|Yes| F[Print redacted value]
E -->|No| G{Schema path valid?}
G -->|Yes| H[Explain unset default]
G -->|No| I[Explain unknown path]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +82. Total +90 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Extend the shared schema walker to resolve supported local references before classifying a path, add text and JSON regressions using a webhooks-style referenced route schema, then rerun the focused test and structured review. Do we have a high-confidence way to reproduce the issue? Yes—current main routes all missing authored values through one branch, and the PR source deterministically misclassifies the referenced webhooks route path as unknown. Is this the best way to solve the issue? No—the schema-backed approach is the right owner boundary, but the walker must support local references before it can make an authoritative unknown-path claim. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ee79b0a49ae4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…7369) config get answered identically for a real-but-unset schema path and a path that does not exist, and pointed both at config validate, which only reports whether the current file parses. Use the schema runConfigGet already builds to split the two cases: a known path reports that it is unset and offers a runnable config set command for that exact path; an unknown path points at config schema. Exit code stays 1 for both, in text and --json.
What Problem This Solves
openclaw config get <path>could not tell an operator whether they had a typo or an unset setting.A real schema key with no authored value and a key that does not exist produced the identical
message and exit code:
The first five are real properties (
openclaw config schemalists them); the last two are not.The suggested next step did not help either case.
config validateonly reports whether the currentfile parses and validates — with a valid file it prints
Config valid: ~/.openclaw/openclaw.jsonand says nothing about which paths exist.
Why This Change Was Made
config unsetalready makes this distinction.formatConfigUnsetMissingPathMessage(
src/cli/config-cli-path.ts:215) has a separate, accurate message for a path that only exists onceruntime defaults are applied.
config getnever got the same treatment — andconfig unset's ownfallback tells the operator to "Run
openclaw config get <path>first if you are unsure of thepath", advice that could not work while
config getanswered identically for both.The schema needed to answer this was already in hand:
runConfigGetcallsbuildRuntimeConfigSchemaFromRegistry(...)and used onlyuiHintsfrom the result. The path-walkingmachinery was there too —
schemasAtPath(src/cli/config-cli-path.ts:306), already used bysetAtPath, and already index-aware so array paths are not misreported as unknown.User Impact
The set hint names the operator's actual path, so it is runnable as printed. Both cases still exit 1,
and
--jsoncarries the same distinction throughformatCliJsonFailure. The success path, theredaction behaviour, and all exit codes are unchanged.
Evidence
Production
+15/-7(net +8): one exported predicate over the existingschemasAtPath, and themessage split in
runConfigGet. Tests+91/-9.node scripts/run-vitest.mjs src/cli/config-cli.test.ts— 195 tests passed. New coverage: a setpath returns its value; a valid-but-unset path (including an array-index path) reports "valid but
unset"; an unknown path reports "unknown"; both failures exit 1 in text and
--json.oxfmt --checkclean on all three files.$autoreview --mode uncommittedclean, no accepted oractionable findings.