Repository navigation
fix: restore Git release selection after a macOS self-install refusal - #200876
roboclaw-bot wants to merge 2 commits into
Conversation
Restore only the captured, never-started conversion selection after the native self-install refusal. Keep the previous Gateway serving, preserve changed trial recovery, and report the owed external service action. Co-authored-by: steipete <[email protected]>
|
🦞👀 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. |
Forward the real runtime module and defaultRuntime methods while mocking only log and error. Repair the mock-exports CI failure without isolation annotations or baseline changes. Co-authored-by: steipete <[email protected]>
|
Codex review: blocked before merge. What this changesRestores the previous Git release selection when macOS refuses the first LaunchAgent conversion before the target starts. Example: A dashboard update selects target-build while serving-build remains running as PID 4242, then launchd installation is refused.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Regression provenanceRegression provenance — verified: source commit Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-authored PR provides useful recovery for a confirmed failed-conversion path; source review found no discrete introduced defect. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe managed updater publishes a Git release, then reconciles the native Gateway service; the release owner compensates a refused conversion while the service owner records failure and preserves the incumbent Gateway. flowchart TD
A[Dashboard update] --> B[Managed updater]
B --> C[Git release publication]
C --> D[Native service rebind]
D --> E[Self-install refusal]
E --> F[Restore unstarted selection]
F --> G[Failed update with owed action]
Technical reviewBest possible solution: Keep refused-conversion recovery in the existing release and service owners, preserving the native safeguard and the separate activation work in #200833. Do we have a high-confidence way to reproduce the issue? The linked report supplies native refusal and build-ID traces, and current source confirms publication precedes rebinding without compensation; this review ran no target code. Is this the best way to solve the issue? This is a focused recovery repair: publication captures its own compensation evidence, service recovery invokes it at the pre-write refusal boundary, and every production hunk serves that invariant. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 420247df39b4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +118, Tests +247, Docs +9. Total +374 across 9 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 17, 2026, 7:40 PM ET / November 18, 2026, 00:40 UTC. |
Reported by @hannesrudolph.
Work sessions
Linked for team reference; these sessions aren’t public.
What Problem This Solves
A dashboard update that first converts a macOS Git installation to the release launcher can select its target before launchd refuses the service rebind. The old Gateway stays healthy, but the selected target has never started and cannot recover through the launcher. This PR repairs that refused-update settlement; Gateway-initiated conversion itself still needs an external native service context.
Related: #200833.
User Impact
The refused conversion fails explicitly, preserves the serving Gateway, records the external-shell service action as owed, and restores the captured previous release selection when its exact trial is still unstarted. Started trials, newer publications, replaced links, and changed fallback builds retain their recovery facts. The LaunchAgent self-install guard remains intact.
Why This Change Was Made
The release publication owner now returns the selected link identity, previous release identity, and exact initial trial identity/content. Its compensation uses the existing release-link compare-and-switch operation under the original update executor. The service-recovery owner invokes it only for the native pre-write self-install refusal during conversion, then returns failure instead of proceeding with target activation or plugin convergence.
This rollback is safe for this refusal because the native guard precedes definition publication and service stop, and the unchanged initial trial proves the launcher has not imported the target. Git-release startup migrations and post-activation plugin convergence have not run. This restores selection only; it performs no service restart or data rollback. The installed updater must contain the repair.
The handoff currently starts a detached child on macOS; its separate service launcher is systemd-only.
detached: truechanges the process session, without proving escape from launchd ancestry or resource-coalition membership. The existing macOS restart/park handoff also spawns a detached shell, accepts only lifecycle modes, and cannot execute a service-definition rebind. Theroot-spawner-v1capability check binds the command/executor/root; it does not grant native same-service installation. Service-command root verification and live Gateway build-ID verification remain separate activation requirements. Both observed builds reported2026.11.4, so version equality is insufficient.Evidence
9618c4116960556e5519dd4c3eee404423a93318: the real native guard refused installation, only launchctl reads occurred, and the target remained selected. It is green with the repair, retaining the incumbent PID/build/readiness facts and owed action without verifying the target.883e996ccb263ef650f5a537fed03170aa481024: all 94 distinct focused tests across five named files passed, including the combined refusal regression and service caller suite (39 tests, 9.02 seconds). Node sibling proof: 93 tests, 28.63 seconds.5fa21d8475b66bb2d22af95a45abc11c1f7f9c70: the named conversion regression passes (1 test, 7.68 seconds including setup; test body 162 ms). Touched-file CI-core typed oxlint, formatting, andgit diff --checkpass. Production code is unchanged.mock-exportson883e996ccb263ef650f5a537fed03170aa481024: the runtime mock replaced the real exports. It now forwards the real module and preserves unaffecteddefaultRuntimemethods, overriding onlyloganderror. No isolation annotation, baseline, or script was changed. The old run is not green proof for this head; current-head CI is pending.git diff --checkpass. No broad local build/test/type/lint run was used.9618c4116960556e5519dd4c3eee404423a93318, committed unchanged as883e996ccb263ef650f5a537fed03170aa481024:scoped-clean, no actionable findings. Native observations and CLI child transport remain fixture boundaries. Fresh review of the test-only repair against883e996ccb263ef650f5a537fed03170aa481024, committed unchanged as5fa21d8475b66bb2d22af95a45abc11c1f7f9c70:scoped-cleanat P0–P2; the reviewer verified the module spread against the scanner contract. The original production review remains applicable.Focused validation commands and cost
The modified release-owner test bodies total about 4.5 seconds and the runner test bodies about 0.74 seconds; their combined Node shard wall time was 10.95 seconds, including imports and worker setup. At the implementation head, the regression body took 174 ms and its two-file caller run took 9.02 seconds including setup. The current test-only repair run took 7.68 seconds including setup, with a 162 ms test body. Current-head CI seconds are pending.
The first sibling run exposed two synthetic Linux service fixtures without the manager UID required by the current planner. Supplying that native observation repaired the fixtures; no service-identity guard or expected result was relaxed. The conversion runner's smoke fixture now reports its candidate's actual version so the test also proves successful publication, rather than only observing the earlier fallback-build call.
Current-source trace and native acceptance procedure
Current main was rechecked through the GitHub API at
b08cf89ca9ecb601e519d130c4a7ec3457c0a1ab(11 commits after the task base); none of those commits changes the affected owners. The source links below pin the equivalent earlier main snapshot82a38fb2fe944b76c0604bb8ee1e0697404e64cd. API history identifies #199706 (6747b1ec5ae3de93c92c50d37b51c33ee3370d50) as the release-conversion introduction.The production route is
update.run→ managed handoff → Git-release publication → service reconciliation/activation. The native membership guard checks ancestry and native containment, including reparented children. A never-started target bypasses the launcher's startup recovery.The focused regression composes publication, restart orchestration, the real LaunchAgent installer/native guard, selection compensation, and real update-history/owed-step owners. Native observations and child transport are fixtures. It does not prove a real launchd handoff escapes its job or that a native successor starts.
Native proof must use a dedicated macOS test account/installation and the reviewed updater build:
<checkout>/dist/index.js, with no existing release-launcher conversion. Recordpnpm openclaw gateway status --deep --json, including.rpc.server.buildId, the native PID, the plist bytes, and checkoutdist/build-info.json. Use a distinct target build with the same package version.ps -o pid,ppid,pgid,sess,command -p <pids>, read-onlylaunchctl print gui/$(id -u)/<label>, and read-onlylaunchctl print pid/<pid>. If PID inspection is denied, retain that result and the existing native coalition fallback's observation. Capture which ancestry/containment branch makesisCurrentProcessInsideLaunchdServicereturn true/false. Do not unset markers or issue native service mutations outside the service owner./readyzHTTP 200, the previous release selected, the owned unstarted trial retired, an explicit failed result, andservice-definitionowed with the external-shell action. A changed or started trial must remain available for its existing recovery owner.pnpm openclaw update --yes, then another dashboard update after conversion. Compare target build IDs and confirm the already-converted launcher definition remains unchanged. Finally exercise a latest-stable-to-candidate upgrade in the same isolated native installation before claiming upgrade proof.