Repository navigation
fix(update): preserve restart intent before macOS Gateway shutdown - #155433
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:15 PM ET / September 23, 2026, 02:15 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR records authenticated restart intent before update-driven macOS Gateway shutdown and prevents failed-stop cleanup from deleting a newer restart request. Merge readiness✅ Ready for maintainer review Keep open for landing: the change remains necessary, no actionable patch defect was found, and the installed macOS evidence resolves the earlier native-behavior proof gap. The published updater’s first activation remains explicitly outside this fix. Priority: P2 Review scores
Verification
How this fits togetherThe macOS service controller translates update and Stop requests into LaunchAgent operations. Restart intent tells the serving Gateway whether SIGTERM should drain work for a restart or perform terminal cancellation. flowchart TD
A[Update or ordinary Stop] --> B[Mac service controller]
B --> C{Live update authority?}
C -->|Yes| D[Verify serving process and record intent]
C -->|Ordinary Stop| E[Unload LaunchAgent]
D --> E
E --> F[Gateway receives SIGTERM]
F --> G[Restart drain or terminal shutdown]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +166, Tests +621. Total +787 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep restart classification in the existing native stop and intent owners, with live authorization, safe preparation refusal, and unchanged ordinary Stop semantics. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main's update stop reaches launchctl bootout without recording the intent required for SIGTERM restart classification. The reviewer did not execute a failing macOS run. Is this the best way to solve the issue? Yes. Extending the existing native boundary and intent store is a focused repair, and the installed evidence covers the changed controller behavior without claiming to repair an updater that is already published. 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
History |
|
@clawsweeper re-review The unchanged published head now has real installed macOS qualification in the updated PR body: the installed candidate controller and a published 2026.9.4 Gateway, using an actual isolated LaunchAgent, prove safe preparation refusal, consumed restart intent, native recovery to healthy and ordinary terminal Stop. The immutable 9.4 updater first-activation limitation is explicitly separate and is not claimed fixed. Exact-head required CI is green; please refresh the existing review against this concrete evidence. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
|
…penclaw#155433) * fix(daemon): authenticate managed-update intent before launchd stop * test(update): make native restart intent fixture portable * test: exercise native update caller authority
Backport #155433: e0dc76b Backport #149307: 8a53ee3 Adapted backport #156584: a1107a5 Preserve authenticated pre-stop restart intent and exact cleanup receipts. Probe protected launchd plists through the existing runtime owner. Require a helper cleanup receipt plus unsignalled closure before replacement; same-unit dueling installs retain system restrictions without changing global user-first policy. 143 original focused passes and 50 review-repair passes retain their bindings. Both findings are resolved. Composed native/CLI/restart checks and frozen guards pass; 16 native macOS cases and live system-unit/driver proof remain open. Report credit for the system-service issue: @ion-developing. Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: PollyBot13 <[email protected]> Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
Summary
Authenticate managed-update restart intent before LaunchAgent shutdown. The native stop boundary resolves the selected service environment, revalidates live update authority and serving-process identity, and records process-targeted intent before bootout. Ordinary Stop remains terminal cancellation; a handoff tuple or inherited flag alone is not authority.
User Impact
Update-owned stops preserve the distinction between restart and cancellation. Preparation failure leaves the serving Gateway untouched. Failed native actions clear only their own intent, preserving successor writes even with identical payloads in the same millisecond. No configuration/schema migration, new marker, or native drain-budget change.
Scope
Three production files and three test/support files. The production change is unchanged from the earlier reviewed head. Native caller fixtures now use the actual service adapter and inherited update authority, a real disposable serving process, effective plist, live owner identity, and explicitly isolated handoff SQLite. All original caller scenarios remain; controls cover tuple-only refusal and ordinary external Stop.
Current main was integrated at
44559eb315e09528aa287878494583e32ad9582e, including reload expectation repair3ff189887d035159bb3e609cead6f8b6719bd390. No unrelated assertion repair or supplier production seam is bundled.Evidence
Candidate:
42c3a1dc6c46c4ae5ed941615212112d6bf1760c(published; exact-head CI green).node scripts/check-changed.mjs --base 44559eb315e09528aa287878494583e32ad9582ecompleted successfully in 649.86s, including core types, all 25 core-test typecheck shards, six-file typed lint, both dead-export scans, formatting, ratchets, schema/storage, and import/auth guards. API-direct final-composition review is scoped-clean through P2 with zero findings and whole-file test-quality review. Committed bytes match the tested/reviewed files exactly.Installed macOS qualification
Exact-head package build and supported local packaging completed successfully. The candidate archive SHA-256 is
c0c730a4af6ea7f14436d4839fedf1320c7221043ce3c4aa39cbf31b87ce5597. Installed native-controller module hashes match those emitted from the unchanged published head. The qualification imports installed emitted modules, not a TypeScript source loader, and uses reallaunchctl, process identities, service adapter, update lease and restart-intent storage.Candidate controller × installed published 2026.9.4 Gateway: PASS. A unique task-private LaunchAgent and supported private profile were healthy before each stop. Both state and handoff SQLite files were physically pinned before execution and before opens in every product process; shared handoff paths were denied. No live user service or production database was used.
received SIGTERM; restartingand completed clean shutdown; restart-intent row was consumed./healthreturned 200.received SIGTERM; shutting down, never restart; no intent remained.Redacted observed sequence:
Installed candidate controller × installed candidate Gateway: PASS for the same full native sequence: inspection refusal preserves the serving PID, update stop is classified restart and consumes intent, native recovery returns HTTP 200, ordinary Stop is terminal and the private job is absent. This second cell uses the repository-pinned pnpm 12.4 installation and the identical verified package artifact.
This closes the candidate-controlled native shutdown/refusal/recovery evidence gap. It does not change or prove the immutable published 9.4 updater's own first activation: that old writer still lacks this change. An old-to-candidate activation must not be represented as repaired by code that is not yet running. This PR also does not claim full no-loss/UNIQUE durability, automatic recovery, five-child durability or six-session recovery; those are separate successor/stack obligations, not bundled changes.
CI and landing gates
Exact public head
42c3a1dc6c46c4ae5ed941615212112d6bf1760c: required CI is green in both check-run and commit-status representations (openclaw/ci-gate). CI run 35691894743 completed with 119 successful and 17 unselected jobs; status publisher 35693640726 also completed. Earlier-head failures are superseded by the repaired and tested exact public head, not rerun as false proof.ClawSweeper found no actionable patch findings; its installed-native qualification request is addressed above, with the immutable first-activation boundary expressly retained. No release artifact was published and no live Odin service was restarted or updated.