Repository navigation
fix: repair legacy config during same-version updates - #188716
Conversation
Co-authored-by: steipete <[email protected]>
|
🦞👀 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. What this changesPrepare the existing Doctor repair plan before same-version update admission, including updates without an explicit channel. Example: Run openclaw update without --channel when the installed version is current and gateway.bind is "localhost".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-authored PR repairs a source-confirmed same-version update failure that remains on current main; no introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe CLI updater selects the caller or managed-service configuration, validates it through admission, and passes a source-bound Doctor plan to the existing locked configuration writer before plugin maintenance. flowchart TD
A[Update CLI] --> B[Select installation and profile]
B --> C[Inspect managed service]
C --> D[Preview Doctor repair]
D --> E[Validate source and admission]
E --> F[Write repair and backup]
F --> G[Continue plugin maintenance]
Technical reviewBest possible solution: Use the existing source-bound Doctor planner during same-version admission and retain the existing locked writer, backup flow, and profile checks. Do we have a high-confidence way to reproduce the issue? Current main exposes the missing no-channel plan before installed admission, and the PR records a matching base-red/head-green command integration; this review executed no target code. Is this the best way to solve the issue? This is the smallest complete repair: prepare the missing plan at the existing admission boundary while preserving validation, source identity, profile selection, and persistence ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 899e74744d88. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +12, Tests +34, Docs +5, Other +2. Total +53 across 4 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 30, 2026, 5:52 PM ET / 21:52 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Co-authored-by: steipete <[email protected]>
Related: #188694
What Problem This Solves
Fixes
openclaw updaterefusing an already-current npm installation with legacy config that Doctor can repair, unless the operator also supplied--channel.User Impact
A plain same-version update can repair supported legacy settings, such as
gateway.bind: "localhost", and continue maintenance. The normal config writer preserves the original backup. Unknown fields still fail with actionable Doctor guidance; foreign profiles retain their ownership checks.Why This Change Was Made
Already-current updates skip candidate admission. Prepare the existing source-bound Doctor plan for the selected maintenance config before installed admission, then let the existing finalizer persist it. This reconnects the repair owner without bypassing validation or introducing options, state, or schema changes.
The masked report does not establish that its five rejected fields match this reproduction. Release 2026.10.9 still accepts
agents.defaults.heartbeat; main's later heartbeat retirement uses a separate stateful Doctor migration and is outside this config-only repair. Related rather than closing the issue.Evidence
81cf32d99769: the real update command with file-backed config and the actual Doctor planner/writer exits 1 for a same-version no-channel update; the explicit-channel sibling passes.git diff --checkpass.81cf32d99769plus unchanged owner/fixture context: scoped-clean, no actionable findings. The reviewer could not execute tests in its empty sandbox. pr-simplify retained the existing planner/writer; production +14/-2 lines, net test growth 34 lines with a separate 34-line allocation for the regression and negative control. The +34 allocation matches measured growth; terminal CI classification follows.Installed-package proof now passes on Linux x64 / Node 26.12.1 through the real installed CLI, using
openclaw update --no-restart --yes --jsonwithout a channel or tag:invalid-config; current and registry target both 2026.10.90c0d540cc23876d33d4ee977ccaab7f38925dd7d, installed over that npm prefixstatus: ok; current and target both 2026.10.9gateway.bind: localhostbecomesloopback;agents.defaults.pdfMaxBytesMb: 23becomespdfMaxMb: 23; canonical.bakequals the original bytesunknownSetting: trueinvalid-config, actionableopenclaw doctor --fixguidanceThe original and successful canonical-backup SHA-256 are both
f0bd909915af582cb8e48aa3a41604aa47b0767607c4f9f03d00391cd760aff0. The candidate retained its exact0c0d540build identity after update. Its canonical package build and tarball integrity check passed, using a pinned source archive and a private copy of the worktree dependencies verified against the frozen lock. The registry's actuallatestwas 2026.10.9; the source package already declares 2026.10.9. No version edit, registry stub, package-target override, or admission bypass arranged equality.Fixture prerequisite: the newly created published state needed main's existing client-credential custody migration before the positive update case could run. The existing credential-only
doctor --client-credentials --fix --non-interactive --jsonsucceeded in the disposable profile. A temporarily valid config selected the local engine; that command left its config bytes unchanged. The exact original legacy bytes were restored before update. No legacy-config Doctor repair was run as preparation. The final GREEN and negative control used that same prepared state. GREEN took 16.185s; the negative control took 16.341s. This proves the config repair and backup contract, not migration of arbitrary real user databases.All mutable files stayed in the proof directory, with isolated HOME, npm prefix/cache, XDG directories, state/config selectors, and temp storage. Final runs used unprivileged filesystem namespaces and Landlock to hide protected host trees and service sockets, deny service executables and TCP binds, and keep normal CLI logic intact. Their syscall audits show zero successful protected-file accesses, service-command executions, or TCP binds. No Gateway started. An initial HOME-only attempt unexpectedly executed service diagnostics, inspected the host installation, and appended to a shared temp log; it is excluded from proof and documented in the local report. Intermediate temp/process-identity and credential-custody setup failures are also excluded. No further Podman or Testbox attempt was made.
macOS arm64 and the reporter's exact masked fields remain unverified. The PR is mergeable, so no rebase was needed; source and the prior independent review remain unchanged.
The first full-file local attempt passed 14 cases but its wrapper rejected changed input bytes during formatting; the frozen full-file rerun timed out on the loaded host after 12 passing cases. Only the final frozen four-case run above is claimed as final touched-contract proof. No issue comment, release, live Gateway change, prepare, or merge.
Exact-head CI 41132188644 reached terminal failure on unchanged head
0c0d540cc23876d33d4ee977ccaab7f38925dd7d. Changed Node tests, type checks, lint, and all three PostgreSQL conformance shards passed. The only underlying failure was baseline ratchets / test-lines: total 6,310,666, ceiling 6,309,597, overage 1,069, net growth +34. The +34 allocation matches this PR's +34 lines, leaving the base's absolute debt unchanged. The aggregateopenclaw/ci-gatealso failed because of that ratchet result; the other executed checks passed.Base evidence is qualified: the exact prepared base's push run skipped this job after a security-fast failure. The current hourly main ratchet job explicitly reports 1,041 lines of existing ceiling debt and passes only because its net growth is zero. The automatic classifier calls the PR failure new because that main job passed; manual inspection shows positive growth exposing existing ceiling debt, with no new allocation deficit. This is not a same-exit baseline match or a passing gate. No allocation enlargement, scalar change, unrelated test deletion, ignore, rebase, prepare, or merge was performed.
The maintainer accepted this inherited-debt exception at 22:06Z (same precedent as #188560). The ratchet and aggregate gate remain red; no budgets, ignores, or tests were changed for that failure. The existing hosted review has no code findings; its posted installed-CLI proof hold predates the evidence above. No fresh hosted review was requested.
Work sessions
Credit: @steipete; the existing commit retains the requested human
Co-authored-bytrailer.