Repository navigation
fix(update): restore Gateway and clear stale warnings after repair - #151003
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: blocked before merge. Reviewed September 17, 2026, 7:03 PM ET / 23:03 UTC (Revision 8). ClawSweeper reviewWhat this changesThe PR makes update repair restore its stopped Gateway after failures, fence timed-out writes, and clear acknowledged recovery warnings from CLI and Control UI reports. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful follow-up to the merged repair fixes. The previous deadline/restoration finding is addressed, the supplied upgrade evidence satisfies the earlier compatibility reminder, and no new blocking defect was identified. Priority: P1 Review scores
Verification
How this fits togetherUpdate repair coordinates Doctor and plugin maintenance against an installed OpenClaw instance. Its parent manages Gateway restoration, while the update ledger supplies recovery status to the CLI and Control UI. flowchart TD
A[Update repair request] --> B[Inspect update history]
B --> C{Maintenance needed?}
C -->|No| D[Acknowledge recovered run]
C -->|Yes| E[Parent acquires service custody]
E --> F[Doctor and plugin repair]
F --> G[Restore and verify Gateway]
G --> D
D --> H[CLI and Control UI report]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +278, Tests +471, Docs +2, Other +304. Total +1055 across 44 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep Gateway custody with the repair parent, fence expired work, and derive recovery prompts from the existing ledger acknowledgement. Do we have a high-confidence way to reproduce the issue? Yes, source identifies the fatal deadline path that bypassed restoration, and the supplied executable regression reports failure before the fix; this read-only review did not run it. Is this the best way to solve the issue? Yes. Reusing Doctor's maintenance owner and the existing deadline machinery avoids competing service owners, and acknowledgement changes preserve historical records. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c16e3db100bd. 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)
|
237dcaf to
4682dc0
Compare
13f084e to
b9b816e
Compare
|
Addressed the deadline/restoration finding from this review in e3bfd95611f1fb8bc2541fecdec0c2833cf15ba2. Fatal finalization deadlines now cancel and fence mutation work, join it within a bound, and unwind through restoration using the original live maintenance instance and revalidated native service ownership before the deferred failure exit. The executable regression fails pre-fix with the Gateway stopped; Linux qualification with the published 2026.9.4 driver and managed-service fixture now refuses the late real config write, records the plugins/15000ms warning, restores and verifies the Gateway, releases custody, and preserves exit 1. The 367 selected tests, check-changed, and both cycle checks pass; fresh committed-branch P1 review is scoped-clean (0.87). The native CI watcher reports CONFLICTING on this head, with no pull_request run attached; no CI rerun or landing was attempted. |
e3bfd95 to
91358d3
Compare
|
Merged via squash.
|
Fix intermittent Canvas and dashboard sandbox failures in Linux real-Gateway tests. The shared fixture previously selected a kernel client-range Gateway port while the lazy sandbox used the adjacent, unchecked port. An outbound connection could occupy that sandbox port before its listener started. Use the existing port-block allocator to check Gateway and sandbox listeners outside the Linux client range, then retain exact Gateway-port reservation across CLI work and restarts. Explicit caller-owned ports remain caller-owned. Production behavior and browser waits are unchanged. Validation: exact-head CI run 35297154119 is green; recorded Linux proof covers the original collision, 78 helper tests, 20 Canvas file repetitions, and the complete 30-file/60-test real-Gateway suite. Committed-branch Codex review is scoped-clean and the landing rebase is patch-identical. Related: #151003, #150983
Fixes openclaw#151081. Reported by @ThaMan666. Recover update repair for stopped externally managed systemd Gateways by preserving the existing external policy in fresh Doctor children and resolving shared systemd templates to the authenticated account instance. Keep the deployment owner responsible for stopping and restarting its service, with lifecycle and database admission still enforced. Acknowledge untouched package-owner refusals once the installed version satisfies the resolved target. Revalidate the latest ledger record, exclude active updates and retained recovery, and preserve the original refusal detail and finish time. Runs that reached installation or finalization still require normal repair. No configuration, CLI, dependency, or database schema changes. Parent-owned service parking for full repair of a running managed Gateway remains with openclaw#151003. The maintainer accepted this scope separation and deferred ClawSweeper's corresponding P1 and rank-up move to that companion. Validation: exact-head CI run 35272975075 passed with zero pending checks; the review of record is scoped-clean. Recorded focused suites passed 2,766 tests with 6 skips, along with the runtime build and changed-code checks. Native systemd proof compared published 2026.9.4 failure with successful installed-candidate stopped-service repair. Legacy refusal acknowledgement used an explicitly synthetic record and kept the service PID unchanged.
…penclaw#151003) Complete update repair recovery after successful acknowledgement or failed finalization. Keep Gateway maintenance custody in the update parent, fence expired mutation work, and restore and verify the owned service before preserving the original failure exit. Doctor children do not activate their parent's Gateway. Clear acknowledged recovery warnings and actions in CLI and Control UI reports while retaining historical failure records. Reuse the existing Doctor maintenance, activation deadline, and update ledger owners. Preserve recovery guidance for ordinary maintenance refusals and legacy failed-history handling without adding configuration, CLI options, database schema changes, or dependencies. Related: openclaw#150950 openclaw#151132. Also related: openclaw#150942. Reported by @shadesurgeon. Validation: exact-head CI run 35284407181 passed with zero pending checks; committed-branch review is scoped-clean. Existing proof includes 430 selected tests, 177 survivor tooling tests, changed-file and import-cycle checks, and the published 2026.9.4-driver Linux qualification. The injected 15000 ms plugin deadline refused a late config write, restored the Gateway, released custody, and retained exit code 1. That qualification uses a systemd fixture with real Gateway processes. Synthetic before/after screenshots show cleared recovery prompts with historical failures preserved.
…aw#151140) Fix intermittent Canvas and dashboard sandbox failures in Linux real-Gateway tests. The shared fixture previously selected a kernel client-range Gateway port while the lazy sandbox used the adjacent, unchecked port. An outbound connection could occupy that sandbox port before its listener started. Use the existing port-block allocator to check Gateway and sandbox listeners outside the Linux client range, then retain exact Gateway-port reservation across CLI work and restarts. Explicit caller-owned ports remain caller-owned. Production behavior and browser waits are unchanged. Validation: exact-head CI run 35297154119 is green; recorded Linux proof covers the original collision, 78 helper tests, 20 Canvas file repetitions, and the complete 30-file/60-test real-Gateway suite. Committed-branch Codex review is scoped-clean and the landing rebase is patch-identical. Related: openclaw#151003, openclaw#150983
Related: #150950 #151132. Also related: #150942. Reported by @shadesurgeon.
What Problem This Solves
Successful
openclaw update repaircould leave stale failure warnings and recovery actions visible, full repair delegated service activation to its Doctor child, and updater children omitted valid recovery guidance on ordinary maintenance refusals. An explicit finalization deadline could also exit the parent before asynchronous Gateway restoration, leaving the managed service stopped.The original 2026.9.4 self-conflict is already fixed on main by #147720 (
fe645cd77de7), and missing failure reasons by #147286 (d10ef37bfd56). Both fixes are included in the 2026.9.5 cut. This is a normal follow-up that completes the recovery UX.User Impact
Healthy abandoned-run recovery stays online. Full repair stops and restores its owned Gateway through the update parent; Doctor children never stop or restart it. A fatal phase deadline cancels work, fences late writes, allows bounded settlement, and records the phase/deadline warning. The parent restores and verifies the Gateway before exiting with the original failure code. A restoration failure identifies the problem and the restart command. CLI and Control UI recovery prompts clear after acknowledgement while historical failure records remain available.
Unavailable service inspection still allows state repair under its database owners without claiming service authority. Other maintenance refusals retain the independent
openclaw doctor --fixrecovery step; only the explicit self-parent activation refusal omits that guidance.Why This Change Was Made
Reuse Doctor's maintenance owner in the update parent: acquire lifecycle ownership before service stop, release database fences before fresh Doctor children, then restore and verify the owned service after convergence or failure. Inspect newer failed post-core attempts, including legacy rows with empty reasons, so an older abandoned row cannot bypass necessary finalization.
Keep acknowledgement predicates in the browser-safe record owner. Both record and legacy-expiry modules consume the type-only
update-run-recovery-state.tscontract; the value dependency is record → legacy expiry, which owns the terminal reason. Recovery guidance follows the actual parent-activation refusal, rather than the presence of an update-parent marker.Finalization reuses the activation deadline owner for cancellation and bounded joining. Native service custody is acquired and restored outside the canceled mutation phase; restoration revalidates the original live maintenance instance and current native service ownership. Terminal exit follows restoration instead of bypassing its
finally.No config options, CLI options, database schema, or dependencies change.
Evidence
63bc9ba3ac62fb118f19d2496eb02c76ccd078dc): the deadline proof is an internal phase of the explicitly selected abandoned-update qualification. Its logic now lives in the already-registeredabandoned-update.mjsCLI asdeadline-hookanddeadline-verify; the separate unregistered helper was deleted. Knip configuration and the scenario catalog are unchanged.pnpm deadcode:unused-filespasses with 0 production and 0 full-tree unused files. All 177 survivor plan, registry, and systemd-fixture tests pass. Before/after executable CLI checks produced identical hook bytes and verification output, and both rejected invalid late-write evidence.node scripts/check-changed.mjspassed after the move.2d05f4c3b677105cf98c58732862713c85c08e0e, containing fix(update): recover external systemd service repairs #151132. The fresh-Doctor external-policy handoff, authenticated systemd template-instance resolver, refusal-only fast path/classifier/transaction, and new refusal cases were preserved byte-for-byte. Three import hunks were resolved in the repair command, its test, and the run ledger; the existing four commits were preserved, followed by the test-only assertion commit.stop → plugins-entered → late-write-refused → restart, keeps config unchanged, records the warning, releases custody, and preserves exit code 1. Copied, consumed, released, and concurrently revoked maintenance handles cannot restore the service.node scripts/check-changed.mjsandgit diff --checkpass. Both runtime and Madge import checks report 0 cycles. No suppressions, baseline growth, or test weakening.91358d3a7345eddd0c63258f4028bfccc9897a66(--mode branch --base origin/main --max-priority P1) is scoped-clean (0.85). Production code is unchanged. The tooling-only consolidation received a local Codex review: scoped-clean (0.97).systemd --user; Doctor never issued a service mutation. Provider:blacksmith-testbox; leasetbx_01m2rp119n18z8rfzhetze66sb; qualification run; wrapper exit 0, command time 13m58s; lease stopped. Qualified source:16da82964cc0c47e9b421ced2749f0daea32b191; later commits strengthen test assertions and consolidate the helper, without changing production code. The consolidated helper preserves generated-hook bytes and verification output.The Linux transcript includes:
Latest tooling fix: +140/−146 (net −6), with no production changes. Whole PR: production +701/−423 (net +278); tests/proof +861/−86 (net +775); docs +22/−20.
Before repair acknowledgement (synthetic fixture):
After repair acknowledgement (the historical failed phases remain):
Latest review disposition
The exact-head ClawSweeper review on
63bc9ba3ac62fb118f19d2496eb02c76ccd078dcreports no actionable findings. Its remaining data-model compatibility checklist item is satisfied by the published 2026.9.4-driver Linux qualification described above: it exercises legacy failed history, including empty failure reasons, while retaining the existing ledger schema and persistence format. The review itself confirms that this evidence satisfies the earlier compatibility reminder. No additional migration or schema change is needed. No other Rank-up moves remain.The committed-branch review of record at this head is scoped-clean, with no actionable P0/P1 findings. The native CI watcher confirmed run 35284407181 is GREEN with zero pending checks. The existing synthetic before/after screenshots were inspected again and displayed in the landing chat; both PR attachment URLs resolve to the expected images.