Repository navigation
fix(macos): show how to recover when the Mac node fails to start - #129874
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 12:53 AM ET / 04:53 UTC. ClawSweeper reviewWhat this changesThe PR preserves up to two structured Merge readinessNo 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 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherThe 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]
Before merge
Agent review detailsSecurityNone. PR surfaceOther +18. Total +18 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
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 installandopenclaw node startcommands 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 4Seven affected owner, caller, installer, launch-agent, onboarding, and update suites passed 103 tests:
swiftlint lint --config config/swiftlint.yml apps/macos/Sources/OpenClaw/NodeServiceManager.swift apps/macos/Tests/OpenClawIPCTests/NodeServiceManagerTests.swiftcompleted with zero violations.swiftformat --lint apps/macos/Sources/OpenClaw/NodeServiceManager.swift apps/macos/Tests/OpenClawIPCTests/NodeServiceManagerTests.swift --config config/swiftformatpassed.node --import tsx scripts/native-app-i18n.ts verifypassed; 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.