Repository navigation
fix(update): report invalid config instead of database schema failures - #149571
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: needs maintainer review before merge. Reviewed September 15, 2026, 11:10 PM ET / September 16, 2026, 03:10 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR identifies invalid update configuration accurately, preserves dry-run guidance, updates recovery recognition, and adds regression coverage and troubleshooting documentation. Merge readiness✅ Ready for maintainer review This remains a useful, focused correction absent from current main and v2026.9.4. The earlier recovery finding is resolved, and no actionable introduced defects remain. Priority: P2 Review scores
Verification
How this fits togetherThe updater reads configuration before checking database compatibility and changing the installation. Its failure classification feeds CLI output, update history, and guided recovery verification. flowchart TD
A[Update request] --> B[Read configuration]
B --> C{Configuration valid?}
C -->|Yes| D[Check database compatibility]
C -->|No| E[Config failure and repair guidance]
E --> F[CLI output and update history]
F --> G[Verify later recovery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +56, Docs +14. Total +70 across 8 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep configuration failures distinct from database incompatibility throughout reporting and recovery, while preserving admission safeguards and the documented installed-updater limitation. Do we have a high-confidence way to reproduce the issue? Yes: current-main source deterministically assigns the database reason to invalid configuration, and the supplied stock-package runs reproduce it with an unknown key or invalid gateway.port. This review did not execute the CLI. Is this the best way to solve the issue? Yes: correcting the existing classification owner and its dry-run and recovery consumers is a narrow repair; it adds no competing validator or migration policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c1c870a41755. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
f525595 to
06feda2
Compare
|
@clawsweeper re-review Addressed the recovery finding in |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The only change since the clean review is commit |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
openclaw#149571) * fix(update): identify invalid config before schema inspection * test(update): simplify invalid-config regression cases * fix(update): verify recovery after invalid config refusals * test(update): align unreadable config refusal expectation
Related: #148255, #148314, #148359, #148744, #148991, #149259, #149555
What Problem This Solves
Fixes
openclaw updatereportingdatabase-schema-preflightwhen its actual failure is invalid or unreadable configuration.User Impact
Updates identify this condition as
invalid-config, retain sanitized field diagnostics and Doctor guidance, and include the existing typed failure facts in reports. Dry-run JSON keeps its successful best-effort response with the same repair guidance innotes. Guided recovery recognizes the saved config refusal after a later successful update and retains its installed-runtime, Doctor, Gateway-readiness, and ownership checks.The installed 2026.9.4 updater performs this check before staging a candidate, so a new release cannot change that already-installed driver's behavior. Operators must correct the configuration before retrying. The docs explain how to retrieve the original refusal with
openclaw update status --jsonbefore a dry run replaces the latest history.Why This Change Was Made
The config admission owner was using a database failure reason for a config validation failure. This uses the existing
invalid-configcontract and its existing diagnostic propagation. The recovery validator recognizes the same reason alongside schema admission failures, completing the downstream cutover without weakening verification. Core-only validation, config preservation, source-change checks, and newer-schema protection remain enforced.Stock 2026.9.4 also hardcodes
mode: unknownfor package preflight refusals and omits the resolved target from its generated report. Those fields do not establish failed installation detection. The seven related reports lack enough information to attribute their individual causes; invalid config reproduces their report shape, but this PR does not claim to resolve every report.Evidence
[email protected]installation reproduced both unknown top-level keys and an invalidgateway.portasdatabase-schema-preflight; status retained the selected target and refusal text.no-map-spreadlint error; explicit test fields fixed it, and all four command cases were rerun successfully.pnpm buildpassed. The built CLI emitsinvalid-configin JSON/history for both failing config cases and preserves the incompatible-agent control. With a running isolated Gateway, config bytes remained unchanged and/healthzremained HTTP 200 after update, status, and dry-run.origin/main, P1: scoped-clean, no actionable findings. Reviewed head:be57790729a5bc8afbe10b88be73a751e0566576. Review artifacts are retained outside the repository.invalid-config; all 26 schema-artifact tests pass, including unreadable-config refusal, metadata-free schema checks, source preservation, and active WAL writers.Isolated live stock matrix and limits
Tested on macOS arm64, Node 26.8.2, with isolated home/config/state/prefix, a free loopback port, and a foreground Gateway owned by the test. The published package supplied its own CLI
dist.already-current, exit 0already-current, exit 0database-schema-preflight, exit 1database-schema-preflight, exit 1already-current, exit 0already-current, exit 0database is lockedbefore ledger admissionStock and main both use state schema 17; the real main-created incompatibility is agent schema 20.
agentDiralone does not select update candidate database paths; the additional session.store cases exercise that selection.No schema-inspection contention refusal or unchanged-config race was reproduced. The separate writer-lock admission failure is outside this diagnostic correction. Windows and Linux reports remain unclassified without their original ledger detail.