Skip to content

fix(mac): keep node service aligned with the latest connection mode - #127732

Merged
steipete merged 1 commit into
mainfrom
codex/mac-node-service-operation-ownership-20260821
Aug 22, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/mac-node-service-operation-ownership-20260821

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where macOS users who switch between local and remote Gateway modes, or receive an app update during a mode change, can end up with the Mac node service running in local mode or stopped in remote mode. An older node start, stop, or update-triggered restart can finish after the newer requested action and silently leave the persistent service in the wrong state.

Why This Change Was Made

Connection-mode generation guards protect their callers after each await, but cannot undo an already launched independent service-management subprocess. Make the node-service owner serialize all three mutating operations through one predecessor-task lifecycle actor, matching existing native coordinator patterns. Fold the previously duplicated action execution, timeout, error, and profile policy into that owner. Read-only status polling remains independent; production decreases by one line.

User Impact

The Mac node now ends in the state requested by the latest local/remote mode transition or app update, even when a previous service command is slow. Named-profile behavior, existing action-specific timeouts, not-loaded handling, and status checks remain unchanged.

Evidence

  • A real-subprocess regression uses a temporary fake OpenClaw CLI, blocks the first command, then races start→stop, stop→start, and restart→stop. Before the fix, all three scenarios fail twice: the newer subprocess starts prematurely and the older subprocess leaves the service in the wrong final state (six failures total).
  • After the owner fix, all 159 native macOS tests pass across NodeServiceManagerTests, ConnectionModeCoordinatorTests, GatewayProcessManagerTests, GatewayEndpointStoreTests, DashboardWindowSmokeTests, and MenuContentSmokeTests; the three real fake-CLI subprocess orderings all end in the correct state.
  • The subprocess proof executes production command resolution, process launching, JSON parsing, and lifecycle methods while guaranteeing the temporary fake executable is selected; no real operator launchd service is touched. Native dashboard smoke tests additionally exercise actual macOS windows.
  • SwiftFormat, SwiftLint, git diff --check, and independent Codex review all pass. Production: +29/-30 (net -1); tests: +74/-0.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos size: S maintainer Maintainer-authored PR labels Aug 22, 2026
@steipete
steipete merged commit 8b5a02c into main Aug 22, 2026
61 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the codex/mac-node-service-operation-ownership-20260821 branch August 22, 2026 01:17
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant