Repository navigation
fix(update): keep config field details and distinguish read failures from invalid config - #158455
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: blocked before merge. Reviewed September 25, 2026, 8:05 PM ET / September 26, 2026, 00:05 UTC. ClawSweeper reviewWhat this changesThe branch changes how OpenClaw's updater classifies configuration read and validation failures, carries field details into saved results, sanitizes public reports, and updates tests and CLI documentation. Merge readiness⛔ Blocked before merge - 2 items remain Current main and the latest release still have the diagnostic gap this PR addresses. The branch is useful and recent; the remaining merge question is how its result behaves when a published updater invokes the candidate. Priority: P2 Review scores
Verification
How this fits togetherThe CLI updater reads configuration during installed and candidate admission and again during plugin convergence. A refusal feeds local guidance, saved recovery, and an optional sanitized public report. flowchart LR
A[Installed updater] --> B[Candidate admission]
B --> C[Configuration snapshot]
C --> D{Read or validation failure}
D --> E[Local refusal]
E --> F[Saved recovery]
F --> G[Sanitized public report]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +75, Tests +89, Docs +6. Total +170 across 23 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make local update refusals identify the actionable configuration field or read cause while public reports reveal only safe schema families, and verify that behavior through a published updater invoking the candidate. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main conflates unreadable and invalid configuration in candidate admission, and the PR's isolated tests exercise the affected updater paths. I did not run the updater. Is this the best way to solve the issue? Yes, a shared snapshot-derived classifier and the existing public-redaction owner form a narrow repair. Published-updater proof is still needed to establish the upgrade result. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b74bd07a2fb0. 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
|
…from invalid config (openclaw#158455) * fix(update): retain config refusal details and distinguish read failures * fix(update): retain config path in validation guidance * test(update): construct config cases without map spreads
Backport #158354 from b31c0ac. Backport #158455 from 31cd888. Source author: Peter Steinberger. Record otherwise-unreported settled failures before interactive reporting; keep nested primary failures, pending recovery and committed outcomes intact. Observer failures cannot replace or redeliver terminal results. Distinguish config-read-failed from invalid-config at the target's existing owners. Keep local rejected-field detail while masking operator keys and values in public reports. Do not import main-only candidate admission or alter no-op ordering. Preserve unavailable-source write fencing. Move all three legacy result assertions to a complete typed snapshot fixture. Repair the preexisting settlement test's incomplete ChildProcess cast with an unspawned real ChildProcess, retaining the seven original assertions. Proof: terminal 10 red then 77 green; installed config 8, classification 20, public reporting 106, triage 66, migrated assertions 3, config siblings 79, settlement fixture 7. These are distinct scoped receipts, not a full-suite claim. Production and owning CLI/config/services types, lint, frozen ratchets and independent review pass. Unchanged linked-plugin/real-npm baseline failures remain recorded. Database composition proof and publication remain pending. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
What Problem This Solves
Fixes update refusals losing configuration-field details and mislabeling configuration loading failures as invalid configuration, including on same-version updates.
Refs #158191 #157873 #157846.
User Impact
Validation failures retain local file and field paths and sanitized public key families. File, include, and configuration-processing failures report
config-read-failedwith the appropriate next action. The distinction survives admission, post-core plugin convergence, and saved recovery.Why This Change Was Made
One config-failure owner now supplies the reason, bounded facts, and guidance. The snapshot reader uses existing diagnostic metadata without broadening the unavailable-source write/reset guard. Existing candidate-protocol field lines are compacted before diagnostic normalization can discard them; the protocol and post-core assessment shapes remain unchanged.
Same-version updates still need usable configuration for channel persistence, state-path admission, and maintenance. Doctor remains the owner of supported legacy repairs. Typed SQLite maintenance errors already propagate on main; this change preserves that behavior and does not replace the separate database rollback repair. Older installed updaters cannot recover diagnostics they already discarded.
Evidence
pnpm test src/cli/update-cli/schema-preflight.test.ts --maxWorkers=1: 39.757 / 29.266 / 26.795 seconds wall, 10.239 / 10.028 / 9.401 seconds test time. Focused proof.src/gateway/gateway-models.profiles.live.test.ts. That explicit live-only gap is recorded below. All other 45 remaining files passed: 1,065 tests, including both channel files, with production code unchanged by the final fixture-only lint repair (final runtime proof). The command took 1,411.956 seconds including 614.5 seconds of native build preparation.node scripts/check-changed.mjs -- <all 23 changed paths>passed on final tree730cfa0cb0a7154cd02b975a7fcb715a2f753ac0in 507.616 seconds, including all selected type graphs, lint (zero warnings/errors), dead-export scans, and subsequent guards (final changed-check proof, leasetbx_01m3dbhwebk3qw50rdxypqf30x). All 23 source hashes were reverified after execution. Fresh independent Codex autoreview of the complete final candidate passed with no actionable P0–P2 findings.Focused test cost (three passes per file)
Measured with
pnpm test <file> --maxWorkers=1; wall time includes shared preparation. These are the latest applicable runs, including the report/redaction repeat after the strict-indexed-access correction and schema-preflight after path restoration.update-command-invalid-config.test.tsupdate-command-plugins.degradation.test.tsupdate-command.test.tsupdate-failure-report-prepare.test.tsupdate-triage-resolution.test.tsdiagnostic-support-redaction.test.tsschema-preflight.test.tsChanged-file lint identified an unnecessary map/spread in the invalid-config case table. The fixture now constructs the same cases directly, preserving all assertions, and passed 8 tests three times.
The new post-core read cases take about 6–7 ms; existing plugin scenarios dominate that file's test time.
Change size: production +171/−96 lines; tests and fixture support +194/−105; docs +9/−3. Proof uses isolated Linux state. Hosted CI timing is pending the PR run.
Known gaps / follow-ups
src/gateway/server.chat-cli-auth.test.ts—chat.send keeps native account history when a saved token appears and uses it for a new session > preserves account selection and session historytook 46.565 seconds in the broad run. This pre-existing scenario combines six real Gateway turns, account transitions, and a deliberate Gateway restart. Reducing that composition's cost belongs in a separate fixture/scenario follow-up; it is accepted as non-blocking for this PR. No timeout, retry, assertion, or skip was changed.test/e2e/qa-lab/runtime/doctor-auth-secretref-checks.e2e.test.ts—preserves SecretRef ownership while proving resolution, fallback, exec gating, and token generationpassed in 229.946 seconds. This pre-existing scenario composes six full Doctor CLI calls. Its process-composition cost is also retained as a follow-up under the slow-gate ruling; no test timeout, assertion, or execution path was changed.src/gateway/gateway-models.profiles.live.test.tsis excluded by the normal Gateway configuration (**/*.live.test.ts). Selecting it alone for that shard produces “No test files found” and stops the serial runner. It remains an explicit live-provider coverage gap; the other remaining import files are checked separately.The original reports omitted the rejected field, so this change cannot identify those installations' particular config error or establish a Node-version defect.