Repository navigation
fix(update): verify every managed Gateway restart attempt - #155355
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 22, 2026, 10:08 PM ET / September 23, 2026, 02:08 UTC (Revision 8). ClawSweeper reviewWhat this changesRoutes updater restarts through the installed Gateway CLI, verifies every attempt, recognizes empty service override metadata, and preserves retained PATH ordering during service regeneration. Merge readiness✅ Ready for maintainer review This remains useful work: current main and the latest release retain the verification gap. The updated published-driver evidence resolves the previous upgrade concern; source review and retained recovery coverage reveal no actionable blocker. Priority: P2 Review scores
Verification
How this fits togetherThe updater reconciles an installed Gateway with its operating-system service after replacing application code. Service ownership checks control regeneration and restart, followed by health verification and recovery reporting. flowchart TD
A[Installed updater] --> B[Service ownership inspection]
B --> C[Preserve or regenerate definition]
C --> D[Target Gateway CLI]
D --> E[Native service manager]
E --> F[Health and readiness verification]
F --> G[Update result or guarded recovery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -752, Tests -1028, Docs +5, Config 0, Other -1. Total -1776 across 34 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one native restart owner with unconditional post-attempt verification and preserve operator settings through the existing service audit and guarded recovery paths. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main can attempt an unknown-version package restart without final verification, and empty systemd override objects prevent eligible rebinds. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Yes. Reusing the existing native CLI removes competing restart logic, while the metadata and PATH repairs retain ownership checks and the unchanged preservation audit. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1dd82fa0d398. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Remove the generated shell and PowerShell restart helpers in favor of the target installation's Gateway CLI. Verify attempted restarts even when the target version is unknown, while retaining structured native refusal, readiness-pending, and unhealthy-start outcomes. Related: #150153
Dependency graph guard clearedThis PR no longer has dependency changes awaiting review. A future dependency graph change from an external contributor requires a maintainer's
|
Keep the existing safety admission and preservation audit unchanged, then reorder admitted PATH locations around the retained definition. Move PATH policy to its existing daemon owner and exercise normalization, repeated entries, and installer regeneration through planner/audit tests. Code success with reconciliation pending remains intentional.
f0e4ce6 to
e394dd5
Compare
|
Merged via squash.
|
…55355) * fix(update): verify every managed Gateway restart attempt Remove the generated shell and PowerShell restart helpers in favor of the target installation's Gateway CLI. Verify attempted restarts even when the target version is unknown, while retaining structured native refusal, readiness-pending, and unhealthy-start outcomes. Related: openclaw#150153 * fix(update): recognize empty managed service overrides * fix(daemon): preserve retained PATH precedence during regeneration Keep the existing safety admission and preservation audit unchanged, then reorder admitted PATH locations around the retained definition. Move PATH policy to its existing daemon owner and exercise normalization, repeated entries, and installer regeneration through planner/audit tests. Code success with reconciliation pending remains intentional.
What Problem This Solves
Updater restarts used a separate generated shell/PowerShell implementation, and some target-CLI restart attempts without a known version could skip final Gateway verification. Ordinary systemd metadata could also be mistaken for operator overrides and prevent an otherwise eligible rebind or recovery. Service regeneration could reorder retained PATH locations and fail the unchanged preservation audit.
User Impact
Every attempted managed Gateway restart uses the target installation's CLI and receives final verification. Confirmed empty override metadata remains eligible for the existing rebind/recovery flow; real overrides and unknown inspection results retain their safeguards. Native refusal, unhealthy startup, and readiness still pending remain distinct outcomes. Required service-runtime refresh failures still fail.
On Linux, regeneration preserves retained PATH precedence, including repeated and normalized spellings, while prepending newly added managed locations. Existing-only locations still pass the established safety filters. Code-update success can coexist with pending service reconciliation; a stopped service stays stopped until repaired.
Why This Change Was Made
Reuse the existing Gateway restart owner and remove the generated helper and its transient path plumbing. A shared service-command predicate distinguishes known-empty metadata from actual or unknown overrides in planning, observation, restoration, and legacy fingerprint normalization. Restoration uses the authored base so an omitted working directory stays omitted, while full restored-command equality remains required.
PATH merging now belongs to the existing daemon path-policy owner. It orders already-admitted entries around the retained definition, preserving the original safety filters, Darwin behavior, and service-preservation audit. No public options or storage contracts change. Related: #150153.
The qualified candidate removes 752 application lines and one tooling line from its base, plus 1,028 test/support lines. Documentation adds five lines explaining reconciliation outcomes and retained PATH ordering.
Evidence
The exact published head is
e394dd53e70e464a1ef8de74da01be6e9b715922, tree1797d4b7134c7f743b994258707fe148c4983903. It merges cleanly with the audited main snapshot without another source refresh.The five-file PATH correction passes 354 tests across seven files, including planner/auditor coverage for duplicates, normalized paths, backslashes, and trailing separators. Its full selected changed gate passes types, lint, formatting, and the remaining guards. Fresh independent P0–P2 review has no actionable findings. The selected test command took 78.00 seconds; the changed gate took 712.94 seconds. These are validation timings, not a performance comparison.
The unchanged service-metadata repair retains its earlier 76-case owner proof. Exact-head CI run 35793684314 passed at
e394dd53e70e464a1ef8de74da01be6e9b715922, including its required CI gate. Preflight verified merge072d8410awith that candidate as its second parent. The exact-head package and corrected native install-rebind acceptance now pass. One 95,719,594-byte candidate package has SHA-256710033f736cb12b24aed46f119265dd38fc2f2233b01bfc0dcb71669fe6e6790.Exact-candidate native acceptance
The real installed
e394dd53candidate updated itself between two stable installation prefixes using that same package. The live update executor reached the target CLI's nativegateway install --forcereconciliation path, moving the managed service from the original prefix to the driver prefix. The native service and authenticated Gateway observations agreed on the PID change from 21304 to 28887. The refreshed service was already healthy, so the existing owner correctly skipped a redundant explicit restart.Update history records
succeeded; service readiness, exact candidate identity, both session messages and metadata, and agent schema 23 were preserved. Derived history-envelope observation fields were allowed to refresh. Independent verification rehashed all 405 archive members and 147 compact evidence files, and verified lease cleanup. A separate verification rehashed the package and acceptance receipts and inspected the native command and PID observations.This cell proves candidate-to-same-candidate native rebind. It is separate from the genuine published-driver cell below. Independent rebind receipt SHA-256:
10d4752ccf239b946a91286b5368a8dd43f5c90c25775f646aab3308569a9069.Published 2026.9.2 upgrade and recovery coverage
The genuine published
[email protected]driver at commit3928bad9badfcb6c7d140530435e806fb8092190successfully installed the same frozene394dd53package. Native and authenticated observations verified the Gateway PID changing from 29068 to 30733 and serving the exact candidate. Agent schema upgraded from 19 to 23; session metadata and both messages were preserved exactly. Durable update history records success, candidate Doctor exited successfully, and the native post-core path executed once.Independent verification rehashed all 339 archive members and 125 compact files. The published driver's missing optional continuation-row identity remains a diagnostic; it is not relabeled as a successful continuation check. SSH exit-255 cleanup warnings are retained, while terminal inspection confirms the lease, host, and provisioning resource are gone. Published-driver receipt SHA-256:
a6ac96d574c664a9fdb4a6dcf2d6699e53ae331b0ed6ffea874da944fd94fe29.Recovery coverage comes from the retained 67 original-service and nine root-plan cases, whose owner/test postimages remain unchanged. They exercise the real update/recovery orchestration with simulated native manager, HTTP, and package transport, covering readiness/health failure, missing packages, authority revocation, replaced definitions, and restored fingerprints. Together with the repaired PATH suites and the two live cells, these supply the selected proof. No native failed-activation recovery result is claimed.
Retained source-bound proof and original failures
74b22ee3cut: 38 changed-check components, nine restart-log cases, a canonical package build, and two real Linux source-owner → built-CLI → systemd restart cells. Those cells replaced the PID and verified health/readiness, with and without required service refresh. They are not new runs of the final candidate, a complete published-driver upgrade, or macOS/Windows whole-CLI proof.2dd1ef59production source. Both complete owner suites then passed 76 cases: 67 original-service cases measured 199.70 seconds and nine root-plan cases 0.044 seconds. Review was clean. The rebased correction preserves that patch; the PATH follow-up does not change its admission or recovery/reporting behavior.8e33aa9728ca24978e160fcd8830a57b1d2d2bdd, tree3a2db9e3ef3ef77e8bbc663290c2134071b2018b. That evidence belongs to its original source tree and does not qualify the new published head.d6088404native acceptance failure, theglobal-install-foreign-destinationresult, and original fixture/setup failures remain preserved. The PATH correction leaves the preservation audit intact. The passing exact-e394dd53stable-prefix cell above is a separate result and does not rewrite those failures.The exact-head source, CI, package, and native rebind proofs are complete. The genuine published-driver proof and the explicitly bounded recovery coverage are also qualified. Native preparation, required CI, and merge admission passed; this exact candidate landed as
b855e24dac7d67ad0cf7b902ddecf42f97ef197c. The actual merge-parent delta matches the qualified patch, all application postimages are byte-identical, and the native receipt and ownership-scoped cleanup are complete. No production deployment or release is claimed.