Repository navigation
fix(update): complete already-current updates before service membership guards - #159193
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 real behavior proof before merge. Reviewed September 27, 2026, 8:43 PM ET / September 28, 2026, 00:43 UTC (Revision 9). ClawSweeper reviewWhat this changesThe branch completes already-current updates with deferred-maintenance warnings, permits managed updates when native containment is absent, bounds readiness and backup cleanup, and accepts unchanged plugin source bytes after a timestamp-only change. Merge readiness⛔ Blocked before merge - 6 items remain Current main still lacks the branch’s already-current and absent-containment update behavior. A merged plugin fix covers only part of the plugin work. The service-stop authority case and a published-driver upgrade on the current head still need proof. Priority: P0 Review scores
Verification
How this fits togetherThe installed flowchart LR
A[Update request] --> B[Installed updater]
B --> C{Core already current?}
C -->|Yes| D[No-op or deferred maintenance]
C -->|No| E[Service identity check]
E --> F[Package and Gateway recovery]
D --> G[Result and update status]
F --> G
Before merge
Findings
Agent review detailsSecurityNeeds attention: No new dependency, secret, or workflow execution surface was found; the broadened managed-service stop authority needs forbidden-caller proof. PR surfaceSource +263, Tests +1045, Docs +40, Other +29. Total +1377 across 46 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one installed-updater path for no-op reporting and managed service recovery, with native membership checked at the stop boundary and the resulting warning preserved in update status. Do we have a high-confidence way to reproduce the issue? Yes, current-main source places service admission before the already-current completion and has no absent-containment result. The supplied published-driver trace exercises the repair on an earlier head; this review did not run the bug. Is this the best way to solve the issue? Yes, moving the no-op decision ahead of mutable admission and reusing the managed service lifecycle is a coherent owner-level repair. The changed stop authority still needs final-effect proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 86c4bf83e699. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What 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
HistoryReview history (8 earlier review cycles)
|
Keep unreadable membership and genuine service descendants guarded while allowing verified external callers to use the existing managed stop/update/start lifecycle on hosts without native containment. Record the lifecycle warning at terminal reporting, retain inspected service state for already-current maintenance, and exercise the managed Docker recovery and no-op paths.
Reuse the restart deadline for native readiness reads and managed recovery. Restore the retained package and previous Gateway when startup never becomes ready, and retain obsolete backups with a warning when the cooperative cleanup budget expires.
af3f367 to
6d7763e
Compare
…ip guards (openclaw#159193) * fix(update): complete already-current updates before service membership guards * refactor(update): prepare maintenance warnings in the no-op owner * fix(update): manage updates when native containment is absent Keep unreadable membership and genuine service descendants guarded while allowing verified external callers to use the existing managed stop/update/start lifecycle on hosts without native containment. Record the lifecycle warning at terminal reporting, retain inspected service state for already-current maintenance, and exercise the managed Docker recovery and no-op paths. * fix(update): bound readiness observation and backup cleanup Reuse the restart deadline for native readiness reads and managed recovery. Restore the retained package and previous Gateway when startup never becomes ready, and retain obsolete backups with a warning when the cooperative cleanup budget expires. * fix(plugins): retain source identities across native captures * fix(update): preserve observed readiness timeout failures
What Problem This Solves
Fixes updates refusing on already-current installs or managed Gateways without native containment identity, and fixes plugin capture errors encountered during update Doctor checks.
Related: #158314 #158231 #157786 #157812.
User Impact
Already-current updates finish as a no-op. Deferred maintenance and unapplied channel changes are reported. Real updates on verified owned services with absent native containment use managed stop → update → start and record the membership warning in the result and
openclaw update status --json.Genuine Gateway descendants, native service members, and present-but-unreadable observations retain their guards. Recovery guidance identifies an external shell not started by the service and the documented
openclaw gateway stop && openclaw update --yes && openclaw gateway startsequence under the same account/profile/state paths. The managed alternative isopenclaw gateway call update.run --params '{}'; Linux needssystemd-run.Readiness uses the existing deadline and rollback owner. When startup never becomes ready, rollback restores the verified previous package and Gateway after command cleanup settles. Obsolete backup cleanup uses the existing five-minute cooperative budget and retains remaining backups with a warning. It joins pending filesystem operations, so genuinely stuck kernel I/O can extend that cleanup wait. No public config/environment/CLI switch, dependency, or schema change is added.
Why This Change Was Made
The no-op owner previously entered mutation admission too early. It now decides whether maintenance is needed first. Membership observations distinguish absent containment from unreadable facts, while preserving ancestry and real native containment refusals.
The Docker follow-up exposed two plugin capture defects. Independent caches can change hardlinked companion files' ctime without changing bytes; this PR accepts that case only with matching remaining identity fields and a fresh hash. Main's #159650 now owns identity reconciliation for overlapping native namespaces, including copied and hardlinked companion regressions. This rebase keeps that implementation verbatim and drops this branch's superseded native-admission logic and duplicate shared-companion test. The separate cross-cache regression remains, and the final source-integrity checks stay strict.
The docker-seed first published-driver hop runs
--no-restartby design. The fixture stops its bootstrap Gateway before that hop. The “Gateway was already stopped before repair; repair did not start it” standalone Doctor path depends on #159577 (armed, not yet merged at this publication checkpoint). This PR does not add a competing start path. No missing package-swap-to-Doctor await was established: activation and plugin convergence already await their owners. The historical CI artifact did not retain the exact failing source identity/stack; the two capture defects were reproduced independently at their owning boundary.This rebase keeps main's
run.shbehavior where it overlaps, including its no-op assertions, native-assignment coverage, and foreground/managed-service transitions. This supersedes the earlier scenario-only reversal of 39db93e in the branch. The separate recovery-update cell still selects an emulated service without native identity through a private fixture argument and verifies the warning in both result and status.Evidence
Current head:
6d7763e4a46c2f442ac2382cee1866b4e5d26144; rebased base:ac5891921c3480e761681f3be830088c94038578; tree:c7000badba497666e394a1610272f63f93f19083.af3f367094f66d5294531183fe360930b885ab32.doctor-error×3: 19 suites / 509 passed / 6 existing platform skips per round, walls 127.47 / 75.63 / 74.42 seconds; the unchanged process regression passed separately in 3.573 / 3.074 / 3.416 seconds. Testboxtbx_01m3jmntdae4fsa7pq2j14zn47, hydration 36360268719.node scripts/check-changed.mjs --base origin/main: passed, delegated exit 0, 1492.564 seconds (24m 52.564s). All typechecks, formatting, lint, and policy guards passed. Testboxtbx_01m3jmntdhncdf9xfn29hbp9rm, hydration 36360268296, now stopped; its later portal-sync warning did not change the succeeded/exit-0 result.319a3f6f3ef2d9904d3c71aa0a1e871e78c0fa01; reused after the subsequent test-only conflict resolution because all 20 production patch files remain byte-identical.5d26c380b6ddf2116b4291b354d6d7064d013bb8; the dependency note is retained. A final merge-tree check exits 0 against newer fetched maindf1273803188cbc4bf7c2d282a9f9f14e3bbf393. Both final proof leases are stoppedThe earlier
af3f367094f6tree passed 41 suites ×3 (1516 tests/6 existing platform skips per round), the process regression ×3, all 744 additional readiness importer tests, and the changed gate. Those remain prior-head evidence; the fresh results above cover this conflict resolution. Its test/check leasestbx_01m3jfbj4ksvh9ez8zsky0nfqgandtbx_01m3jfbjcbq20y1sd405mzn28dare stopped.Full CI run 36348823256 passed docker-seed-e2e on
0da84e6b09a50837fa5aa1ffe25c0866db8a56cf, including published-upgrade-survivor and legacy-operator-update-noop. No new Docker run is claimed for this rebase. The lead owns the next dispatch on the pushed head; the branch remains unchanged after that handoff. Auto-merge stays OFF.Docker timing audit
The 1032-second base lane contains two updates plus standalone Doctor, fixture startup, and assertions. Its first published-driver
--no-restarthop took 230.394 seconds; the candidate recovery update took 614.459 seconds. Compared with the prior rig on identical production files, the retained recovery substeps increased from 139.577 to 303.883 seconds (+164.306 seconds): snapshot, candidate Doctor, package swap, and post-swap Doctor all slowed. The first hop also increased by 104.612 seconds before final readiness.The wait owners return on successful observations: health polling is 500 ms with the existing 12-observation settle contract (5.5 seconds spacing), HTTP readiness returns on its first successful healthz/readyz pair, deadline timers cancel after completion, and backup removal adds no sleep. Healthy observations return before startup-renewal handling. Historical identical-production proof used about 4.935 seconds of the previous-Gateway 300-second budget and recorded final verification at 2.178 seconds.
The exact slow operation in this CI run is not proven. Artifact
10942752169clips recovery JSON at 16 KiB before readiness and cleanup; 310.576 seconds of the recovery phase remain unassigned. The job log retains heartbeats only. This cannot exclude an actual deadline expiry in that run. It does not support an unconditional five-minute wait, so no speculative performance change or shorter failure bound is introduced. Main's retained comparison artifact covers a different legacy cell without the candidate recovery hop and is not an equivalent total-time baseline.Timing follow-up: preserve numeric phase timings beyond the artifact's 16 KiB log projection and profile the 310.576-second unassigned recovery tail on the same published-baseline scenario; its awaited operation and any actual deadline expiry remain unproven.
Attribution of the other CI reds
The comparison main hourly 36351907942 is green at
da2bcd699bc11789ef35b43f61b2e27dc0c03861, the immutable base used for the attribution replays. It runs Node-only UI3/3, omits the session-reader case, excludes board-fixture from reduced UI, and omits numbered core-tooling suites. Its green result does not exercise those PR failure modes. Exact red matches below refer to the prior main hourly 36348256572. A passing replay is not treated as a fix.aea578dbe03ad0e79e5d9563a4b0c6fbb52e9242(#159853 native locale refresh). The comparison main run native-i18n job108712154654 passed (preceding20:30 job108701958900 also passed). PR has no locale/source changes.ui/src/app/web-push.test.ts, “ignores a stale preference action after switching Gateways”; initial preference value undefined instead of fixture preference (approvalRequested: true). Node half passed; Bun half 1 failed/8177 passed.OPENCLAW_CI_TEST_RUNTIME_POLICY=node), passed512files, and passed this exact case in157ms. The full PR dispatch was dual and failed only Bun; no landed fix identified. Base original dual shard reached Node: original case passed (153ms); a separate physical-checkout fixture error occurred and Bun was missing. Prerequisite-repaired canonical Bun partition passed 512 files / 8,130 tests in 139.07 s; the original case passed in 153 ms. This is a bounded non-reproduction, not a fix. The comparison main run uses the same shard arguments with its current inventory. The preceding20:30 main job log returned HTTP404; the latest21:29 log is available and proves Node-only execution of this case.session-pr-reader-lifetime.real-gateway.e2e.test.ts, “keeps session PR and CI results with the current workspace and reader”, 120000ms timeout./chatroute success, document complete and roster count1/noerror. Timeout is after Gateway connection, not updater readiness. The comparison main run real-Gateway jobs108712154903/108712154951 passed but decoded includePatterns omit this test (11+13 files); their green result does not prove this case. The preceding20:30 jobs had the same omission. First base source-config attempt was blocked before test execution by linked-dependency build preparation (39.95 s). After physical dependency isolation, the single source case passed (52.058 s test, 81.19 s Vitest, 127.88 s wall including 31.7 s runtime build). This does not prove a fix for the earlier CI timeout. The exact awaited operation is still not proven. CI used Node24.21/prebuilt/full inventory; this bounded replay used Node24.19/source/single suite.board-fixture.e2e.test.ts:244, “serves background task 1 through both chat entry points”;sessions.describereturns null session for retired mock-task-1.6652f7eac8d9(#159179 Task retirement): deletedbuildBackgroundTasksMock, spread of background task sessions/transcripts, and mock init fromscripts/control-ui-mock-dev.ts; test remains unchanged on current main. The comparison main run ordinary E2E passed, but its compact9-row plan excludes this exact file throughRELEASE_ONLY_UI_TEST_FILES; it is not the full manual12-row inventory. Exact4/12 replay on main da2bcd reproduced the same failure: 1failed/265passed across54files,338.61s.upgrade-survivor-assertions.test.ts, immutable targets2026.6.35/2026.7.33; missing stagednative-assignment-summary.mjs.47b36e516adb4ffe681d65d1721a5ee3dae84da9, explicitly reproduces these two failures and stages helper beside diagnostics. Included in rebase.ci-node-test-plan.test.ts, host database consumers inventory expects deletedsrc/agents/tools/subagents-tool.acp-cancellation.test.ts.ed0a056ce113f680f99bbb78ba23c30ad0134074, removes exact deleted path from database worker inventory (plus three stale entries elsewhere). Included in rebase.upgrade-survivor-candidate-identity.test.ts: three cases fail with/bin/bash: line136: native_assignment_enabled: unbound variablebefore intended candidate byte/tarball assertion.6652f7eac8d9: run.sh added variable initializer before extracted flow and condition inside extracted flow; fixture fails to initialize variable. Candidate-identity test and extracted block match main; L1302 run.sh diff only affects later recovery-update function. Exact-main replay reproduced the same three failures/one pass in 2.12s on da2bcd6. Subsequently fixed on main by069a974b7317302f08f9cab48e71bb55ea599840, now included in this rebase.vitest-scoped-config.test.ts, watch-file ownership expects same deleted ACP cancellation file.ed0a056ce113f680f99bbb78ba23c30ad0134074, same source inventory as tooling14.update-finalization-output.process.test.tsdoctor-error: expected ordinary stopped-service timeout diagnostic; got newGateway restart observation timed out during health-wait:interval.Also twohelp-exit.process.test.tsunknown-provider message drift failures.update-command-readiness.ts: catch overwrites last observed probe error with outer deadline message, while preserving phase but downstream prefers probeError. Fixed here; the unchanged process regression fails before the correction and passes after it. Models failures are main-side stale expectations:74469f58f38c15d14ee4cddf24a498c6c21821adintentionally changed unknown-provider message with guidance; process test expected the old generic message. Main subsequently fixed these assertions in66898a633464, now included in this rebase. No models production/test changes in L1302.subagent-orphan-recovery.restart-integration.test.tsrestart cases expect running, receive interrupted.b459eb600f238d38f8b7156675e5868751f52c54. Included in rebase.artifacts-session-resolution.test.ts, indirect artifact topology promise resolves instead of rejecting.14ef6ab478327e1de0e9ebb3505e908efd4b8c0e(#159819). Included in rebase.openclaw-state-maintenance-resources.test.tscases assert public message “offline maintenance” but receive plugin-state wrapper error.6ad6f1fbe84619ca08620e45cff039aefc04452b(assert cause chain). Included in rebase.Main-side proof: Testbox
tbx_01m3jd155crvmk4h4tz873serg, hydration 36352629756, now stopped. Candidate-identity reproduces all three failures (2.12 seconds). The original UI E2E shard reproduces the board failure (1 failed / 265 passed, 338.61 seconds). After repairing missing pinned Bun and physical dependency placement in the isolated base fixture, the Bun partition passed 8,130 tests / 512 files (139.07 seconds). The real-Gateway source-config case passed (52.058 seconds test; 127.88 seconds total including a 31.7-second runtime build), which differs from CI's prebuilt entry point. This untouched composed test boots a real Gateway (9.3 seconds), creates synthetic repositories, exercises delayed reader transitions, and tears them down; no slow-test fix is claimed. Initial missing-prerequisite runs are not product results. The exact causes of the web-push failure and CI session-reader timeout remain unresolved; no assertion, timeout, retry, or skip was changed.Published-driver proof and capture regressions before this rebase
Docker run
l1302-down-v2-20260927passed 2/2 cells on published 2026.9.5, 4 CPUs / 8 GiB, with unchanged lane budgets: base 497 seconds, managed legacy 337 seconds. Testboxtbx_01m3hypk7mxsm2vf1g9hfpzkda, hydration 36337213937; delegated command exit 0, 1266.510 seconds including packaging. This proof is bound todf51cee08b80d230cdba53ed503466f5f9d1f9fa/ tree0f58d55662876c23e9332b1ffcfe2b49f814f612and its then-current scenario.Base recovery
2135fcfb-fa10-4a6a-b730-477f6623b3b0completed in 266.515 seconds. Result and status contain the membership warning; status recordssucceeded,serviceRunning: true, matching version,/readyz: true,settled: true, andpluginErrors: []. Standalone Doctor completed without capture/load errors. Managed legacy no-opc0b895eb-1b1a-4393-8ea2-c6f6ba1cbe02returnedskipped/already-currentin 4.787 seconds; Doctor-clean and backup/rollback assertions passed.Both capture regressions fail before their fixes: independent caches reject unchanged companion bytes; a single capture of two native packages sharing a hoisted dependency fails namespace completion. The fixed tests retain old bytes and reject real edits. The new cases each took about 0.5 seconds. The shared-dependency test's post-capture assertions use the dependency-alias API; its original failure occurs before those assertions.
Before rebase, 36 files / 1357 passed / 6 existing platform skips ×3 passed (189.06 / 117.81 / 116.68 seconds). No individual test exceeded 30 seconds. The combined three-round proof plus full changed gate exited 0 in 1847.658 seconds on Testbox
tbx_01m3j16rcmfftbtznzrxfh7ej0, hydration 36339910512. Final direct-route P1 review was scoped-clean. All those leases were stopped.The earlier unchanged-head replay
l1302-down-before-20260927passed standalone Doctor and completed its recovery update with the Gateway running, but failed the warning assertion: main's #159498 had supplied a real kernel cgroup, so an absent-membership warning was inappropriate. The private fixture selection repairs that proof shape. An intermediate after-proof exposed the second namespace-completion defect and was not counted as green.The earlier hang in CI run 36297746253 showed the replacement ready and healthy before terminal output stopped. Its exact awaited operation was not proven. The guarantee here is bounded readiness observation with existing rollback, plus cooperative backup retention on cleanup expiry; a passing replay does not establish the original hang's exact cause.
Other CI failures and retained follow-ups
From CI run 36331301585:
108653843814)update-candidate-state.budget.test.ts, “budgets schema inspection for large database,” failed at a five-second fixture-ready wait before simulated budget advancement (case 13.155 seconds). Test and inspection/process owners matched base/head/inspected main. Outside this PR's delta; exact blocked startup stage unresolved. No baseline replay claimed.108653843700)10936281328:WebChatWindowLifetimeTests.swift:235never observed injected transporthistoryStarted(case 15.970 seconds, three-second polling allowance). Test and Swift owners matched base/head/main; it exercises synthetic transport/cache. Outside this update change; native scheduling cause unresolved.108653843713)f389bd5883552febbb1940ad4e6a541d621b8f95settles initial boot before the SimSlim deadline.Earlier
pr-prepare-crabbox-resumeandcron-message-readfailures were reproduced on the immutable base and attributed to their main-side fixtures.session-pr-reader-lifetimeremains an unresolved UI timeout outside this PR; a passing replay was not treated as a fix. The restart-outcome VM fixture drift was repaired here while preserving its backup assertions.Explicit performance waivers remain: CI test-perf owns
ci-changed-node-test-plan.test.ts(206 s),ci-node-test-plan.test.ts(143 s), andpackage-acceptance-workflow.test.ts(142 s). CLI test-perf ownsupdate-command-service-custody.test.ts(31 s deliberate delay) andupdate-command-original-service.test.ts(151 s/67 cases). L1305 / #159577 owns moving the three real-driver cases fromdoctor-config-preflight.refusal.process.test.tsto the live tier (132–141 s in earlier runs). These files are not changed here.Doctor-maintenance tooling follow-up (slow-test gate explicitly waived): unchanged
doctor-health.test.tstook 123.341 / 121.942 / 123.482 seconds across 72 cases; repeated synchronous SQLite inspection children during admission checks need profiling at that owner. This PR does not change the fixture, assertions, or timeout.A prior P1 concern about cgroup namespace roots was checked against the typed native producer: missing, malformed, or failed
ControlGroupreads stay unknown; a real non-root unit remains a guard. The approved warning-bearing default for genuinely fact-poor hosts is retained. The final direct-route review accepted this disposition with no actionable P1 finding.LOC against the rebased base: production +509/−246 (net +263); tests/support +1276/−231; fixtures +36/−7; docs +41/−1.
The follow-up commit changes one production line (+1/−1, net 0) and no test lines; it preserves the existing deadline and rollback behavior.