Repository navigation
fix(update): keep malformed-config previews free of state, cache and scratch artifacts - #187498
Conversation
…scratch artifacts Skip persisted migration facts and history while a preview has no selected config-driven database engine. Render prepared preview results without publishing reports or support bundles; preserve actual refusal and unexpected failure diagnostics. Extend the built-CLI process regression across text/JSON and absent/native databases, including full cache and scratch tree snapshots. Fixes #187431. Thanks @shakkernerd.
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR prevents malformed-config update previews from inspecting databases or creating report, support, cache, and scratch artifacts. Example: Run openclaw update --dry-run --no-restart --timeout 1 with configuration containing { definitely-not-json.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs a confirmed preview side effect still present on main; no introduced correctness or security defects were found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe update CLI reads authored configuration, resolves update admission and target facts, and renders either a preview or an actual update result with diagnostic artifacts. flowchart TD
A[Update CLI] --> B[Authored configuration]
B --> C[Scoped engine selection]
C --> D[Target and admission facts]
D --> E[Preview renderer]
D --> F[Actual update result]
E --> G[Console output]
F --> H[Reports and support artifacts]
Technical reviewBest possible solution: Keep the focused repair in the existing engine-selection and result owners while preserving actual-update refusal diagnostics. Do we have a high-confidence way to reproduce the issue? The linked report gives concrete built-CLI reproductions, and current-main source confirms the unresolved-engine reads and unconditional report publication; no target code was executed during this review. Is this the best way to solve the issue? The patch fixes the causes at their existing owners, preserves real-failure reporting, and adds meaningful process coverage without new state or parallel machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8b38db564c72. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +13, Tests +39, Docs +2, Other +3. Total +57 across 7 files. Added test files: 0. View PR surface stats
Review metrics
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 29, 2026, 4:41 AM ET / 08:41 UTC. |
…scratch artifacts (openclaw#187498) Update previews with unparseable config no longer read plugin-migration facts or update history while the database engine is unresolved, and prepared dry-run results no longer publish update reports or support bundles. Text and JSON previews leave the profile, cache and scratch trees unchanged; real malformed-config updates still refuse with invalid-config and save their report. Fixes openclaw#187431 (follow-up to openclaw#187367). Thanks @shakkernerd for the report.
What Problem This Solves
Fixes #187431. Malformed-config update previews returned the right refusal plan but still inspected SQLite and created report, support, cache, and scratch artifacts. Thanks @shakkernerd for the reproduction and follow-up to #187367.
User Impact
Text and JSON preview plans now leave the complete profile, cache, and scratch trees unchanged when authored config cannot be parsed. Actual-update refusal reporting and readable-config failure diagnostics retain their existing behavior. No configuration or migration changes are required; the installed CLI must contain this fix.
Why This Change Was Made
The preview path read persisted plugin-migration facts and update history while database-engine selection remained unresolved, then the text renderer published a normal update report. Both reads now consume the engine owner's scoped selection. Preview rendering reuses its captured run facts, and the result owner does not publish artifacts for a prepared
dry-runresult. Unexpected command failures retain their diagnostic reports.The existing built-CLI process regression covers text/JSON previews with absent/native-initialized databases, compares the full profile/cache/scratch trees, rejects report/support artifacts, and observes file-backed SQL diagnostics. The legacy-config case keeps its original contract. Production: +28/-15 (net +13); tests: +60/-21 (net +39). The separate exact 39-line allocation pays for those four real-process boundary cases; the shared scalar is unchanged.
Evidence
cache/openclawandtmp/openclaw.invalid-configand saves its refusal report.check:changedSQLite inventory is omitted under the campaign's local gate budget; PR CI owns broad proof.Process-file timing: Node 66.05 s wall / 40.844 s tests; Bun 32.11 s wall / 27.716 s tests; longest individual test 6.81 s. Wrapper totals include runtime/compiled-worker preparation (139.27 s and 102.93 s). Real CLI startup is required to catch engine selection, filesystem artifacts, and launcher behavior that helper mocks missed. On final source the four affected cases pass again on each runtime (Node 32.35 s wall, Bun 9.07 s wall). The existing 24-case metadata-diagnostic suite passes after narrowing publication suppression to prepared preview results; a recovery run invalidated by that source edit was rerun successfully on the final source (34/34).
All 34 direct/one-module consumer files found from the changed production basenames ran locally in discovery order. After the targeted correction and reruns: 31 files pass, with 689 passing cases and 6 remaining failures across 3 files. Remaining local gaps are reported rather than claimed green:
src/plugins/post-core-dependency-health.integration.test.ts0775mode without sticky protection. Volume permissions and dependency policy were left intact.src/cli/update-cli/update-command-migrated.test.tsrequireinto.jsbeneath the mandated worktree scratch root, inheriting the repository'stype: module. A standalone reproduction confirms that module-type failure. The other 28 cases pass.src/cli/update-cli/update-command-post-update.test.tsretained_plugin_receipt_supersededbut receives redacted Doctor warning text. Transcript preservation and restart assertions preceding it pass; 93 other cases pass. This unchanged owner path mocks the result renderer. A separate-base replay was not performed, so this remains a recorded validation gap.Existing slow-suite evidence:
update-command-original-service.test.tspasses all 48 cases in 241.19 s wrapper wall / 232.918 s test time (longest case 13.65 s). Its existing matrix creates fresh real state and two installation roots per case, seeds and closes native databases, and performs recovery inspections. Recorded under the campaign's pre-existing slow-suite exception. The rollback suite passes all 45 cases with 104.564 s test time (longest 3.867 s).Source base:
00125bb5bbc0bb8e9fb91ee39e6420132041b90e. Submitted head:25cbe4ffb79bc48c01b2b8a5338e44f87cd74226.Commands used for the focused process proof:
The live native-database fixture used isolated
HOME,OPENCLAW_HOME,OPENCLAW_CONFIG_PATH,OPENCLAW_STATE_DIR,XDG_CACHE_HOME, andTMPDIRunder.artifacts/native, withOPENCLAW_NO_RESPAWN=1andNODE_DISABLE_COMPILE_CACHE=1. Exact CLI invocations (the local preload records recursivefs.watchevents):Preview outcomes:
exit=0,tree_unchanged=true,filesystem_events=[],refusal_guidance=truein both output modes. Actual-update control:exit=1,invalid-config, saved Markdown report and Doctor recovery guidance.