Repository navigation
fix(config): return actionable errors for retired settings - #178289
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 126283587d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| writeRuntimeJson(runtime, { | ||
| ...formatCliJsonFailure(`${configFailureHeading(snapshot)}: ${shortenHomePath(snapshot.path)}`), | ||
| ...formatCliJsonFailure( | ||
| `${configFailureHeading(snapshot)}: ${shortenHomePath(snapshot.path)}\n${formatInvalidConfigRepairHint(snapshot, "to repair, then retry.")}`, |
There was a problem hiding this comment.
Preserve caller-specific recovery policy in JSON errors
This helper is also called by the root config guard, not only by config get and config validate. For machine-output commands such as onboard --json, that guard deliberately sets suppressDoctorStdout, and for OPENCLAW_CONFIG_READONLY=1/Nix it selects external-deployment guidance; this unconditional formatter instead places openclaw doctor --fix in the JSON error even though repair was suppressed or cannot modify the immutable file. Keep the generic writer neutral or let these callers supply the applicable recovery hint.
AGENTS.md reference: AGENTS.md:L75-L75
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR reports retired core settings before plugin migration diagnostics and adds repair guidance to JSON configuration errors. Example: Run openclaw config validate --json with skills.workshop.approvalPolicy set to pending.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: this PR addresses a concrete diagnostic problem, but its shared JSON formatter introduces misleading recovery advice for externally managed configuration. Priority: P2 Before merge
Findings
Provenance
Agent review detailsHow this fits togetherConfiguration snapshots feed CLI admission and config commands; validation findings become human diagnostics or JSON failures, while Doctor owns repairs. flowchart TD
A[Config file] --> B[Snapshot validation]
B --> C[Core legacy findings]
B --> D[Plugin legacy diagnostics]
C --> E[CLI error rendering]
D --> E
E --> F[Human or JSON output]
F --> G[Doctor repair]
Technical reviewBest possible solution: Keep the core-first diagnosis, leave the shared JSON writer neutral by default, and let config commands supply the applicable repair hint. Do we have a high-confidence way to reproduce the issue? Current-main source confirms plugin diagnostic discovery before returning core legacy findings and missing JSON repair guidance; the reported prolonged stall remains unproven, and no target code was run during this review. Is this the best way to solve the issue? The early return uses the existing core rules and preserves Doctor ownership, but adding caller-independent recovery policy to the shared renderer is broader than necessary. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 37e60afc6d2f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +13, Tests +91, Docs +2. Total +106 across 8 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 20, 2026, 5:07 AM ET / 09:07 UTC. |
Keep the existing error.message contract and expose recovery guidance in repairHint. Use an ESM provider-policy fixture so isolated Node and Bun consumer tests exercise the same contract.
Match the repairHint added by main in #178289 while preserving exact JSON equality, refusal before node mutation, and the unopened-state assertion. Co-authored-by: VACInc <[email protected]>
…penclaw#178289) Refs openclaw#178177. With a removed legacy key such as skills.workshop.approvalPolicy, openclaw config validate --json and config get printed nothing and hung 30s+. The config snapshot owner now reports known legacy keys before loading plugin diagnostics; JSON failures keep error.message and add repairHint with the openclaw doctor --fix hint.
What Problem This Solves
Config commands did plugin migration work before reporting a known retired core setting such as
skills.workshop.approvalPolicy, and JSON failures lacked recovery guidance.Refs #178177.
User Impact
openclaw config validate --jsonandopenclaw config get gateway.mode --jsonreport the invalid setting without loading plugin migration diagnostics for that known core error. JSON preserves the existingerror.messageand adds recovery guidance in the top-levelrepairHintfield. The commands exit unsuccessfully without changing config or creating state.Why This Change Was Made
The config snapshot owner already knows how to diagnose retired core keys, so it can return those findings before importing executable plugin diagnostics. Doctor still discovers and applies the complete core and plugin migration set. The existing repair-hint policy is shared across human and JSON output, preserving the separate advice for read failures and broken plugin packaging.
Evidence
36b28bb0f51d9006bae3baafa47959b3332e3c8a: known core errors invoke Doctor plugin diagnostics once instead of zero. Prepared real CLI tests verify both commands, exit 1, the invalid key, the recovery hint, unchanged config bytes, and no created state. The minimal fixture did not reproduce the indefinite 30-second stall; it proves removal of the unnecessary plugin-discovery path.error.messageassertions and additionally requirerepairHint. The real CLI regression requires the same additive contract. Human diagnostics and output ordering remain covered.config-guard.test.ts,config-validation.json.test.ts,config-cli.legacy.process.test.ts, andconfig-read-failure.test.ts(55.44s wrapper; CLI shard 42.71s, 79% transform).origin/mainat37e60afc6d2ffb3dab5dee16a52f2aae2554d4abfailspnpm tsgo:prod; its core CI graph produces the same 810 diagnostics as check-prod-types, includingcontrol-ui-components.ts/HTMLElement.a2332caed768dab02dfa6586b478c8f89b819535addedsrc/gateway/chat-display-replay.test-support.ts, which is included by core'ssrc/**/*and imports Control UI. The PR branch passes the production graphs, the CI graph command, and fresh core checks with both available compilers. No type boundary was weakened.OPENCLAW_CI_STATIC_EVIDENCE=1 node scripts/run-tsgo-core-test-shards.mjs --ci-graphs-json '["core","ui","extensions"]'. Branch exit 0; clean main exit 2. After normalizing checkout paths, all 810 core diagnostics match exactly.pnpm devlive proof was refused by the existing artifact-publication/offline-state guard; it was not bypassed. The supported prepared CLI process harness supplied isolated real-command proof.check:changed/SQLite inventory remains omitted under the campaign's local gate budget. PR CI supplies broad proof; the inherited main type failure above remains visible.cli-config-lifetime.test.ts: CommonJSexportsinprovider-policy-api.jsinherits this checkout's ESM package scope. The fixture now uses ESM syntax, preserving all assertions and making Node and Bun exercise the same provider-policy contract. No loader or production plugin behavior changed.git diff --check, and madge (zero cycles) passed. Independent Codex review found no actionable findings.