feat(macos): install and run the local Gateway automatically#99767
Conversation
|
Codex review: needs changes before merge. Reviewed July 4, 2026, 1:07 AM ET / 05:07 UTC. Summary Reproducibility: yes. for the review findings: current-head source inspection shows stale validated CLI cache entries can remain preferred after failed probes, and partial first-run onboarding can still be classified as an existing install. I did not run the macOS app locally in this read-only review. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Fix the two narrow Swift blockers, keep the scoped macOS setup direction, and have maintainers explicitly accept the bundled-installer and exact-local-node auto-approval boundary before merge. Do we have a high-confidence way to reproduce the issue? Yes for the review findings: current-head source inspection shows stale validated CLI cache entries can remain preferred after failed probes, and partial first-run onboarding can still be classified as an existing install. I did not run the macOS app locally in this read-only review. Is this the best way to solve the issue? No, not yet. The implementation uses plausible macOS seams, but cache invalidation and partial-onboarding identity selection need repair before this is the best maintainable setup path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8822b66952b7. Label changesLabel changes:
Label justifications:
Evidence reviewedSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
Land-ready at exact head Local validation:
Hosted proof:
Fresh-machine behavior proof:
Known proof gaps: none for the requested download-to-working-agent path. No VM screenshot was published because external image upload was not approved. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d68de66b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return nil | ||
| } | ||
| guard let required = Semver.parse(requiredVersion) else { return executable } | ||
| return validatedVersion.compatible(with: required) ? executable : nil |
There was a problem hiding this comment.
Revalidate cached CLI before preferring it
When a previously validated openclaw path is later replaced or downgraded, this cache still returns it as long as the stored version string is compatible with the app. applicationDidFinishLaunching does call CLIInstaller.status(), but non-ready statuses never clear cliValidatedExecutableKey, so subsequent launchd/Gateway commands keep resolving the stale executable ahead of other paths and can continue starting/failing against an incompatible CLI until an install overwrites the cache. Clear the cached executable/version when status(location:) reports unusable or incompatible before using it for PATH priority.
Useful? React with 👍 / 👎.
| self.state = AppStateStore.shared | ||
| if let state { | ||
| MacNodeModeCoordinator.prepareNodeIdentityProfile( | ||
| isExistingInstallation: state.onboardingSeen || state.connectionMode != .unconfigured) |
There was a problem hiding this comment.
Don't treat partial onboarding as an existing install
If a first-run user selects This Mac, selectLocalGateway() persists .local immediately, while onboardingSeen is not set until Finish; quitting and relaunching before completion reaches this line and permanently stores the .primary node identity profile. That makes a fresh install lose the dedicated .node identity path and reuses the operator identity for the app-owned node before setup is complete, so the upgrade-preservation decision should be based on a completed/shipped install marker rather than transient connectionMode.
Useful? React with 👍 / 👎.
|
Land-ready at exact head
No screenshots are attached because external image-upload permission was not granted; the live VM path was completed and verified directly. |
|
Merged via squash.
|
…w#99767) * feat(macos): automate local gateway setup * fix(macos): auto-approve the local Mac node * chore(macos): refresh generated setup metadata * chore(macos): refresh generated setup metadata * chore(macos): refresh generated setup metadata * chore(macos): refresh generated setup metadata * chore(macos): refresh generated setup metadata
Closes #99764
Related: #47263
What Problem This Solves
People downloading OpenClaw for Mac could not complete setup from the app alone when the CLI, Node.js, and Gateway were not already installed. Fresh local installs also exposed redundant pairing approvals for the app's own Mac node.
Why This Change Was Made
The app now bundles the canonical CLI installer, defaults onboarding to This Mac, installs and starts the local Gateway, and waits for readiness. Fresh installs use a dedicated node identity; the app silently approves only its exact persisted node identity in local mode. Remote and mismatched nodes keep explicit approval.
User Impact
A new Mac user can drag OpenClaw to Applications, open it, choose the recommended local setup, and reach a working agent without terminal setup or an approval sheet for the app's own node. The first page explains what OpenClaw does and includes a concise permissions disclaimer.
Evidence
hdiutil verify,stapler validate, and Gatekeeper assessment as a Notarized Developer ID application.127.0.0.1:18789, and completed onboarding.approvalState: approved,paired: true, andconnected: true; no node approval sheet appeared during setup.OPENCLAW_E2E_OKin the app UI.swift test --package-path apps/macos --filter NodePairingApprovalPrompterTests— 5 passed.This change was developed and validated with AI assistance. No transcript is included.