Skip to content

fix(update): ignore inherited macOS XPC for respawn#85789

Merged
giodl73-repo merged 1 commit into
openclaw:mainfrom
giodl73-repo:fix-85224-darwin-respawn-supervisor
May 24, 2026
Merged

fix(update): ignore inherited macOS XPC for respawn#85789
giodl73-repo merged 1 commit into
openclaw:mainfrom
giodl73-repo:fix-85224-darwin-respawn-supervisor

Conversation

@giodl73-repo

Copy link
Copy Markdown
Contributor

Summary

  • Fix macOS update respawn supervisor detection so inherited app XPC_SERVICE_NAME values do not masquerade as gateway launchd supervision.
  • Preserve launchd-supervised gateway handling for OpenClaw's explicit OPENCLAW_LAUNCHD_LABEL, matching LAUNCH_JOB_LABEL/LAUNCH_JOB_NAME, and the default gateway XPC_SERVICE_NAME label.
  • Add regression coverage for inherited app XPC, profile collision, detached update respawn, explicit service env, and true gateway launchd labels.

Fixes #85224.

Verification

  • OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 CI=1 node scripts/run-vitest.mjs src/infra/supervisor-markers.test.ts src/infra/process-respawn.test.ts src/daemon/service-env.test.ts
  • git diff --check origin/main...HEAD && git diff --check
  • corepack pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/infra/supervisor-markers.ts src/infra/supervisor-markers.test.ts src/infra/process-respawn.test.ts
  • corepack pnpm exec oxlint src/infra/supervisor-markers.ts src/infra/supervisor-markers.test.ts src/infra/process-respawn.test.ts
  • codex review --base origin/main -> no actionable correctness issues

Real behavior proof

Behavior addressed: On macOS, a gateway spawned from the app could inherit the app's launchd XPC_SERVICE_NAME, causing update respawn to falsely return mode=supervised and exit without spawning a detached replacement.

Real environment tested: WSL Ubuntu 24.04 durable OpenClaw checkout on branch fix-85224-darwin-respawn-supervisor, commit f65b02606f.

Exact steps or command run after this patch: Ran the focused Vitest command above against src/infra/supervisor-markers.test.ts, src/infra/process-respawn.test.ts, and src/daemon/service-env.test.ts, plus diff/format/lint and Codex review.

Evidence after fix: Regression tests now prove XPC_SERVICE_NAME=ai.openclaw.mac stays unmanaged, including OPENCLAW_PROFILE=mac; respawnGatewayProcessForUpdate() spawns a detached replacement for inherited app XPC; OpenClaw's explicit launchd marker and matching gateway launchd labels still return supervised; service-env still emits OPENCLAW_LAUNCHD_LABEL.

Observed result after fix: 3 test files passed, 110 tests passed; diff check, oxfmt check, oxlint, and Codex review passed.

What was not tested: A live macOS LaunchAgent/app update flow was not replayed; this PR uses focused process-env regression proof for the reported supervisor detection branch.

@clawsweeper

clawsweeper Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(update): ignore inherited macOS XPC for respawn This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 23, 2026
@giodl73-repo giodl73-repo force-pushed the fix-85224-darwin-respawn-supervisor branch from f65b026 to 6590bed Compare May 23, 2026 23:14
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels May 23, 2026
@giodl73-repo giodl73-repo force-pushed the fix-85224-darwin-respawn-supervisor branch from 6590bed to 05e7265 Compare May 24, 2026 02:22
@giodl73-repo giodl73-repo merged commit c074d09 into openclaw:main May 24, 2026
98 checks passed
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

respawnGatewayProcessForUpdate falsely reports mode=supervised on macOS when XPC_SERVICE_NAME is inherited from a launchd-managed parent

2 participants