Skip to content

fix(macos): show how to recover when the Mac node fails to start - #129874

Merged
steipete merged 1 commit into
mainfrom
codex/macos-node-service-recovery-hints-20260825
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/macos-node-service-recovery-hints-20260825

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users connecting the macOS app to a remote Gateway would see that their Mac node could not start, but not the actual openclaw node install and openclaw node start commands needed to repair it. The same missing recovery guidance affected managed post-update failures.

Why This Change Was Made

The CLI already returns structured recovery hints alongside unsuccessful node-service results. The native service owner returned its generic failure message before merging those hints, leaving its explicit structured-failure branch unreachable. Merge parsed failure details and bounded recovery hints in the canonical failure path, then fall back to existing raw or generic errors. This removes the dead branch and reduces production code by one line.

User Impact

Remote Mac-node startup and update failures now explain how to install or start the missing service. Existing subprocess exit failures, fallback diagnostics, profile isolation, lifecycle ordering, successful responses, and idempotent stop behavior remain unchanged.

Evidence

  • Authentic pre-fix regression: the existing executable-backed NodeServiceManager.start() fixture failed three cases covering structured failures with exit zero, the real CLI failure with exit one, and recovery hints without a separate error message.

  • Final owner verification passed all six native tests, including eleven lifecycle cases:

    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --package-path apps/macos --filter OpenClawIPCTests.NodeServiceManagerTests --no-parallel -j 4
  • Seven affected owner, caller, installer, launch-agent, onboarding, and update suites passed 103 tests:

    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --package-path apps/macos --filter 'OpenClawIPCTests\.(NodeServiceManagerTests|GatewayLaunchAgentManagerTests|UpdateOrchestrationTests|ConnectionModeCoordinatorTests|NodesStoreTests|OnboardingViewSmokeTests|CLIInstallerTests)' --no-parallel -j 4
  • swiftlint lint --config config/swiftlint.yml apps/macos/Sources/OpenClaw/NodeServiceManager.swift apps/macos/Tests/OpenClawIPCTests/NodeServiceManagerTests.swift completed with zero violations.

  • swiftformat --lint apps/macos/Sources/OpenClaw/NodeServiceManager.swift apps/macos/Tests/OpenClawIPCTests/NodeServiceManagerTests.swift --config config/swiftformat passed.

  • node --import tsx scripts/native-app-i18n.ts verify passed; no native localization strings changed.

  • Independent human-boundary review and structured Codex review reported no actionable findings.

  • Live UI capture was not feasible: reproducing this failure in the installed app would launch the operator's app and mutate the operator-owned node LaunchAgent, both explicitly prohibited for this task. The real subprocess-backed native fixture exercises the exact production error consumed by the macOS node menu and post-update flow.

@clawsweeper

clawsweeper Bot commented Aug 26, 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: XS maintainer Maintainer-authored PR labels Aug 26, 2026
@steipete
steipete marked this pull request as ready for review August 26, 2026 04:48
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 12:53 AM ET / 04:53 UTC.

ClawSweeper review

What this changes

The PR preserves up to two structured openclaw node recovery hints in macOS node-service failure messages and adds executable-backed regression cases.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings. Current main still drops structured recovery hints for failed node-service JSON responses; this owner-boundary repair is the best fix and should remain open for exact-head macOS CI.

Priority: P2
Reviewed head: 82c4d091e7b4c92346a094ec7117d59612f55d4c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with credible regression coverage and no identified correctness or security defects.
Proof confidence 🌊 off-meta tidepool Not applicable: Maintainer-authored PR; its body nevertheless supplies executable-backed native test evidence and explains why reproducing in the installed app would mutate the operator-owned LaunchAgent.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Maintainer-authored PR; its body nevertheless supplies executable-backed native test evidence and explains why reproducing in the installed app would mutate the operator-owned LaunchAgent.
Evidence reviewed 5 items Current-main failure path: Current main computes failure for a JSON response with ok: false, then returns the raw message before the later hint-merging branch; therefore the structured recovery hints are lost.
CLI response contract: The shared daemon response contract explicitly emits failed JSON with error and optional hints; node start supplies node-install/start hints through that contract.
User-visible callers: Remote connection stores the returned node-service error for the node UI, and post-update passes the same returned error to its failure presentation.
Findings None None.
Security None None.

Live Verification

Command: DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --package-path apps/macos --filter OpenClawIPCTests.NodeServiceManagerTests --no-parallel -j 4

Result: FAIL (failed) — step 1 run DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --package-path apps/macos --filter OpenClawIPCTests.NodeServiceManagerTests --no-parallel -j 4: previous terminal command was still running after 30 seconds: "DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --package-path apps/macos --filter OpenClawIPCTests.NodeServiceManagerTests --no-parallel -j 4"

Fetching https://github.com/swiftlang/swift-markdown
Fetching https://github.com/steipete/ElevenLabsKit
Fetching https://github.com/openclaw/Peekaboo.git
Fetched https://github.com/steipete/ElevenLabsKit from cache (0.70s)
Fetched https://github.com/swiftlang/swift-markdown from cache (0.70s)
Fetching https://github.com/orchetect/MenuBarExtraAccess
Fetching https://github.com/sparkle-project/Sparkle
Fetched https://github.com/orchetect/MenuBarExtraAccess from cache (0.28s)
Fetching https://github.com/groue/GRDB.swift.git
Fetched https://github.com/sparkle-project/Sparkle from cache (3.25s)
Fetching https://github.com/steipete/Commander.git
Fetched https://github.com/steipete/Commander.git from cache (1.69s)
Fetching https://github.com/apple/swift-algorithms
Fetched https://github.com/apple/swift-algorithms from cache (0.44s)
Fetching https://github.com/apple/swift-log.git
Fetched https://github.com/apple/swift-log.git from cache (0.42s)
Fetching https://github.com/pointfreeco/swift-concurrency-extras
Fetched https://github.com/pointfreeco/swift-concurrency-extras from cache (0.37s)
Fetching https://github.com/apple/swift-numerics.git
Fetched https://github.com/apple/swift-numerics.git from cache (1.04s)
Fetching https://github.com/openclaw/AXorcist.git
Fetched https://github.com/openclaw/AXorcist.git from cache (0.61s)
Fetching https://github.com/apple/swift-system
Fetched https://github.com/apple/swift-system from cache (0.72s)
Fetching https://github.com/swiftlang/swift-cmark.git
Fetched https://github.com/swiftlang/swift-cmark.git from cache (1.46s)
Fetching https://github.com/swiftlang/swift-subprocess.git
Fetched https://github.com/swiftlang/swift-subprocess.git from cache (0.54s)
Fetching https://github.com/sindresorhus/KeyboardShortcuts
Fetched https://github.com/sindresorhus/KeyboardShortcuts from cache (1.08s)
Fetching https://github.com/mgriebling/SwiftMath
Fetched https://github.com/mgriebling/SwiftMath from cache (0.79s)
Fetched https://github.com/groue/GRDB.swift.git from cache (13.69s)
Fetched https://github.com/openclaw/Peekaboo.git from cache (22.42s)
Creating working copy for https://github.com/swiftlang/swift-markdown
Creating working copy for https://github.com/steipete/ElevenLabsKit
Creating working copy for https://github.com/openclaw/Peekaboo.git
Creating working copy for https://github.com/groue/GRDB.swift.git
Creating working copy for https://github.com/sparkle-project/Sparkle
Working copy of https://github.com/steipete/ElevenLabsKit resolved at 0.1.1
Working copy of https://github.com/swiftlang/swift-markdown resolved at 0.8.0
Creating working copy for https://github.com/apple/swift-algorithms
Working copy of https://github.com/apple/swift-algorithms resolved at 1.2.1
Creating working copy for https://github.com/apple/swift-log.git
Working copy of https://github.com/apple/swift-log.git resolved at 1.15.0
Creating working copy for https://github.com/pointfreeco/swift-concurrency-extras
Working copy of https://github.com/pointfreeco/swift-concurrency-extras resolved at 1.4.1
Creating working copy for https://github.com/apple/swift-numerics.git
Working copy of https://github.com/apple/swift-numerics.git resolved at 1.1.1
Creating working copy for https://github.com/orchetect/MenuBarExtraAccess
Working copy of https://github.com/orchetect/MenuBarExtraAccess resolved at 1.3.1
Creating working copy for https://github.com/openclaw/AXorcist.git
Working copy of https://github.com/sparkle-project/Sparkle resolved at 2.9.6
Creating working copy for https://github.com/apple/swift-system
Working copy of https://github.com/apple/swift-system resolved at 1.8.1
Working copy of https://github.com/openclaw/AXorcist.git resolved at 0.1.6
Creating working copy for https://github.com/swiftlang/swift-subprocess.git
Creating working copy for https://github.com/sindresorhus/KeyboardShortcuts
Creating working copy for https://github.com/mgriebling/SwiftMath
Working copy of https://github.com/sindresorhu
… output truncated …

Assertions:

  • FAIL expect_output: NodeServiceManagerTests

How this fits together

The macOS app runs the local node-service CLI and converts its JSON response into an error shown by remote connection and post-update flows. Structured CLI failure hints now travel through the macOS service owner to those user-visible diagnostics.

flowchart LR
A[Remote connection or update] --> B[Mac node service manager]
B --> C[Node service CLI]
C --> D[Structured JSON failure]
D --> E[Recovery hint merge]
E --> F[Mac error message]
Loading

Before merge

  • Resolve merge risk (P1) - The reviewed head's macOS checks were still queued in the supplied context; merge should wait for exact-head native CI.
Agent review details

Security

None.

PR surface

Other +18. Total +18 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 23 5 +18
Total 2 23 5 +18

Review metrics

Metric Value Why it matters
Production versus regression-test delta production -1, tests +19 The repair removes the unreachable production branch while adding focused executable-backed coverage for the missing recovery output.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the single canonical failure-message path, merge CLI-provided hints there, and land after exact-head macOS validation is green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the single canonical failure-message path, merge CLI-provided hints there, and land after exact-head macOS validation is green.

Do we have a high-confidence way to reproduce the issue?

Yes—source-reproducible with high confidence: a false JSON ok result takes the current-main early return before hint merging, and the added executable fixture models that exact response.

Is this the best way to solve the issue?

Yes. Merging hints at the macOS service owner preserves the existing raw-message fallback and repairs both remote-start and post-update consumers without duplicating recovery policy in either caller.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b1dbdd380369.

Labels

Label changes:

  • add P2: This fixes a bounded macOS recovery diagnostic defect without data loss, security exposure, or core-runtime unavailability.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Maintainer-authored PR; its body nevertheless supplies executable-backed native test evidence and explains why reproducing in the installed app would mutate the operator-owned LaunchAgent.

Label justifications:

  • P2: This fixes a bounded macOS recovery diagnostic defect without data loss, security exposure, or core-runtime unavailability.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Maintainer-authored PR; its body nevertheless supplies executable-backed native test evidence and explains why reproducing in the installed app would mutate the operator-owned LaunchAgent.

Evidence

What I checked:

Likely related people:

  • steipete: Blame attributes the current-main failure branch and its callers to the macOS service work introduced in c406ef4, and the same contributor authored this repair. (role: introduced the current macOS service path and authored the focused repair; confidence: high; commits: c406ef4b4d6e, 82c4d091e7b4; files: apps/macos/Sources/OpenClaw/NodeServiceManager.swift, apps/macos/Sources/OpenClaw/ConnectionModeCoordinator.swift, apps/macos/Tests/OpenClawIPCTests/NodeServiceManagerTests.swift)

Rank-up moves

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

  • Allow the exact-head macOS checks to complete before merging.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit f61ae11 into main Aug 26, 2026
148 of 150 checks passed
@steipete
steipete deleted the codex/macos-node-service-recovery-hints-20260825 branch August 26, 2026 05:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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