Skip to content

fix: gateway restart fails from verified external macOS terminals - #170354

Merged
RomneyDa merged 2 commits into
mainfrom
fix/gateway-restart-ancestry
Oct 13, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
fix/gateway-restart-ancestry

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes macOS openclaw gateway restart failing 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

  • Added a regression through 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 runtime passed (1m 19s); production typecheck, targeted lint, formatting and git diff --check passed.
  • Independent autoreview: no actionable P0–P2 findings.
  • pnpm check:changed stopped at an inherited stale max-lines baseline for extensions/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:test also passed. Full pnpm build was stopped after its unrelated package declaration generation made no visible progress for nine minutes, then the supported runtime build passed.
  • Proof uses the native-service boundary harness; the operator’s live Gateway was not restarted.

CI follow-up: the initial head failed check:test-mock-exports because the edited membership mock did not preserve real exports. The mock now spreads importOriginal, 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.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Restart fails with “Process ancestry could not be fully inspected.”
  • After: Restart proceeds through launchctl kickstart without a detached handoff.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported correction with useful lifecycle regression coverage and limited native runtime evidence.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its restart regression exercises the production lifecycle owner with mocked native observations and service execution, without demonstrating the exact case on macOS.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An external macOS terminal cannot restart its Gateway despite native containment verifying that it is outside the service.
Reason: The maintainer-authored change restores a supported lifecycle operation through its existing owner without adding configuration or changing persisted state.

Regression provenance

Regression provenance — verified: source commit 6209f31ce9bb by Peter Steinberger; canonical PR #158314 (blame-to-merge-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
Reviewed head: a214d835f3dc760c26f1ab77c811e0090427281f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Native macOS evidence does not show this exact incomplete-ancestry external restart and retained in-service protection; base-fail/head-pass execution is reported by the author rather than independently observed.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Complete ancestry requirement after verified native containment changes intended behavior with a stated reason (6209f31: Require complete ancestry and independent native containment before admitting external callers, protecting reparented service members.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6209f31 adds src/daemon/launchd-current-service.ts:47 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6209f31ce9bb; files: src/daemon/launchd-current-service.ts)
  • Dallin Romney: Raw commit eb6330f adds src/daemon/launchd-current-service.ts:64 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: eb6330fe7781; files: src/daemon/launchd-current-service.ts)

PR surface

Source +5, Tests +23. Total +28 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
Tests 2 24 1 +23
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 29 1 +28

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: A supported advanced macOS CLI operation can refuse verified external callers; the evidence does not establish a broader outage or first-run blocker.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture redacted native macOS output showing an external restart with incomplete ancestry and an in-service caller retaining its protected handoff.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-12T22:51:56.953Z sha a214d83 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T22:58:56.598Z sha a214d83 :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 7:10 PM ET / 23:10 UTC (Revision 3).

@RomneyDa
RomneyDa marked this pull request as ready for review October 12, 2026 23:05
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 12, 2026
@RomneyDa
RomneyDa merged commit 364a798 into main Oct 13, 2026
119 of 120 checks passed
@RomneyDa
RomneyDa deleted the fix/gateway-restart-ancestry branch October 13, 2026 00:21
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…enclaw#170354)

* fix: allow gateway restart from verified external macOS terminals

* test: preserve launchd membership mock exports
RomneyDa added a commit that referenced this pull request Oct 14, 2026
…70354)

* fix: allow gateway restart from verified external macOS terminals

* test: preserve launchd membership mock exports

(cherry picked from commit 364a798)
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Oct 16, 2026
…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.
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
Backport openclaw#170354 for the extended-stable release audit.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant