fix: recover live Gateway snapshot updates without a control build#104964
Conversation
c4f0fde to
564eb5f
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 12, 2026, 12:46 AM ET / 04:46 UTC. Summary PR surface: Tests +87, Docs 0, Other +41. Total +128 across 3 files. Reproducibility: yes. Live current-main validation observed the exact fail-closed error while the detached snapshot still owned port 18789, and source inspection confirms the matching branch. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the guarded snapshot-only source-control build path after the exact-head gate is clean, then run the documented real managed-snapshot migration and require successful suspension, native bootout, source retargeting, restart health, log audit, and exact listener ownership before closing the linked issue. Do we have a high-confidence way to reproduce the issue? Yes. Live current-main validation observed the exact fail-closed error while the detached snapshot still owned port 18789, and source inspection confirms the matching branch. Is this the best way to solve the issue? Yes. Building only the verified canonical source checkout to obtain the existing suspension client for an isolated snapshot is narrower and safer than executing snapshot code, weakening stopped proof, or introducing another control mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4139938dcf18. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Tests +87, Docs 0, Other +41. Total +128 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
564eb5f to
05aaec9
Compare
|
Land-ready proof for exact head
After merge I will rerun the updater against that live state and require exact source retarget, launchd/listener ownership, deep RPC health, restart-window logs, Mac app attach-only, node fleet, and agent task proof before closing #104945. |
|
Merged via squash.
|
Closes #104945
What Problem This Solves
Fixes an issue where operators updating a managed macOS Gateway from an immutable runtime snapshot would remain blocked when a concurrent source update invalidated the checkout's last exact control build while the snapshot service was still running.
Why This Change Was Made
When native inspection proves the snapshot is still live, the updater now builds the verified clean source checkout solely to obtain an exact trusted suspension client, then uses that client to fence work before bootout and retargeting. This recovery is explicitly forbidden for a LaunchAgent that targets the source checkout, and snapshot code remains unexecuted.
User Impact
Snapshot-backed managed Gateways can recover automatically from missing or stale source control builds without weakening the active-work fence or mutating a live source-backed
disttree. Already-stopped snapshots retain the existing native recovery path. No release or version change is included.Evidence
main: updater failed closed withGateway control is unavailable and the managed Gateway could not be proven stoppedwhilegateway-508f6a2owned port 18789.node scripts/run-vitest.mjs test/scripts/openclaw-live-updater.test.ts— 44 passed.git diff --check— clean.Live clawmac migration will be retried with the exact landed follow-up implementation. No release.