Repository navigation
fix: gateway restart fails from verified external macOS terminals - #170354
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. What this changesThis PR allows verified external macOS callers to manage the Gateway despite incomplete process ancestry. Example: A terminal outside ai.openclaw.gateway runs openclaw gateway restart; native membership reports outside, but the ancestor walk cannot reach PID 1.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a source-confirmed macOS restart refusal still present on main and v2026.10.2, with no introduced correctness defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe launchd membership owner combines the running service PID, caller ancestry, and native containment into the decision service lifecycle commands use for direct operations, detached handoffs, or refusal. flowchart TD
A[Gateway lifecycle command] --> B[Launchd membership owner]
C[Running service PID] --> B
D[Caller ancestry] --> B
E[Native containment] --> B
B --> F[Direct service operation]
B --> G[Protected handoff or refusal]
Technical reviewBest possible solution: Accept verified outside containment in the existing shared owner while retaining conservative handling of unknown and absent observations. Do we have a high-confidence way to reproduce the issue? Main and v2026.10.2 deterministically reject outside membership when ancestry lacks PID 1; the author reports a base-failing regression, and this read-only review executed no target code. Is this the best way to solve the issue? The focused correction removes the redundant requirement at its shared owner and preserves positive ancestry, native-inside, unknown, and absent-containment handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ed97ab7d2c74. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +23. Total +28 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReviewed October 12, 2026, 7:10 PM ET / 23:10 UTC (Revision 3). |
…enclaw#170354) * fix: allow gateway restart from verified external macOS terminals * test: preserve launchd membership mock exports
…enclaw#170354) * fix: allow gateway restart from verified external macOS terminals * test: preserve launchd membership mock exports (cherry picked from commit 364a798) Backport adaptation: dropped the config/test-mock-exports-baseline.txt edit because the release branch has no mock-export baseline.
Backport openclaw#170354 for the extended-stable release audit. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes macOS
openclaw gateway restartfailing with “Process ancestry could not be fully inspected” from a terminal that native service membership already verifies is outside the Gateway job.User Impact
Verified external terminals can restart the Gateway even when an ancestor cannot be inspected. In-service callers retain detached handoff protection; unknown membership and absent containment retain their existing guards. No config or migration changes. Update/maintenance callers use the same corrected membership owner.
Why This Change Was Made
The native probe returned
outside, but its caller still required the ancestor walk to reach PID 1. This redundant requirement was introduced by commit 6209f31 on September 26 and first appears in release tag v2026.9.7; it is present in the v2026.10.2 tagged source as well as the reported 5b29c85 build. Accept verified outside containment while retaining ancestry checks when containment is absent.Evidence
restartLaunchAgent: it fails before the fix with the reported ServiceInspectionError and passes afterward, reaching native kickstart without a detached handoff.pnpm test src/daemon/launchd-service-membership.test.ts src/daemon/launchd-current-service.test.ts src/daemon/service-process-membership.test.ts --maxWorkers=1: 99 tests passed, 23.19 seconds Vitest wall time. New regression took milliseconds; no timers or process boots added. CI seconds pending hosted run.pnpm build runtimepassed (1m 19s); production typecheck, targeted lint, formatting andgit diff --checkpassed.pnpm check:changedstopped at an inherited stale max-lines baseline forextensions/amazon-bedrock/index.test.ts; both that file and its baseline match origin/main exactly. Targeted lint and production types passed separately;pnpm tsgo:core:testalso passed. Fullpnpm buildwas stopped after its unrelated package declaration generation made no visible progress for nine minutes, then the supported runtime build passed.CI follow-up: the initial head failed
check:test-mock-exportsbecause the edited membership mock did not preserve real exports. The mock now spreadsimportOriginal, and its obsolete grandfathered baseline entry was removed. The exact mock-export check passes, all six affected tests pass (8.07s Vitest wall time), and formatting, lint, diff checks, and fresh independent review passed. Production code is unchanged by the follow-up.