Repository navigation
fix(permissions): use standard macOS Local Network request flow (STA-3505) - #12833
Conversation
…nostic and workaround (STA-3505) On macOS 27 beta, NECP silently denies Orca's whole process tree Local Network access: no prompt fires, the app never appears in System Settings, and terminal child processes fail with EHOSTUNREACH. The Settings trigger swallowed the probe's socket error and reported 'unknown' + a 'Permission request sent' toast, indistinguishable from success. Classify the mDNS probe outcome (EHOSTUNREACH/EHOSTDOWN -> denied, clean send -> granted, else unknown), remember the verdict for the status chip, and render an inline diagnostic with the documented NECP re-evaluation workaround when denial is detected.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change adds macOS Local Network connection testing with typed results, input validation, LAN target checks, timeout handling, and categorized failures. The main, preload, and web APIs expose the test operation. The renderer adds permission actions, localized notices, connection controls, status displays, and persistence for successful tests. Tests cover IPC behavior, connection outcomes, permission requests, settings actions, and restored connection history. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Updated to the standard macOS flowThe earlier denial heuristic and private-daemon workaround were removed. The final implementation keeps Local Network at Check manually, triggers the supported user-initiated request, and provides the standard Local Network Settings fallback without claiming Granted or Denied. |
…-necp-local-network # Conflicts: # src/renderer/src/components/settings/DeveloperPermissionsPane.tsx
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 18429a4a-d694-4ac3-abc8-fdd1cc4c5da0
📒 Files selected for processing (8)
src/main/ipc/developer-permissions.test.tssrc/main/ipc/developer-permissions.tssrc/renderer/src/components/settings/DeveloperPermissionActions.tsxsrc/renderer/src/components/settings/DeveloperPermissionsPane.test.tsxsrc/renderer/src/components/settings/DeveloperPermissionsPane.tsxsrc/renderer/src/components/settings/developer-permission-request-notice.tssrc/renderer/src/components/settings/developer-permission-status.tssrc/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (4)
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/components/settings/developer-permission-request-notice.ts
- src/main/ipc/developer-permissions.test.ts
- src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx
| {id === 'local-network' && ( | ||
| <Button variant="outline" size="sm" onClick={() => void openSettings()}> | ||
| {translate( | ||
| 'auto.components.settings.DeveloperPermissionsPane.localNetworkOpenSystemSettings', | ||
| 'Open System Settings' | ||
| )} | ||
| </Button> | ||
| )} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Disable the Local Network settings action when unsupported.
The request action disables for status === 'unsupported', but the settings action remains enabled. On a non-macOS platform, it can invoke the macOS-only settings URL. Disable or omit this button when pending || status === 'unsupported'.
As per coding guidelines, “Keep platform-dependent behavior behind runtime checks for macOS, Linux, and Windows.”
Source: Coding guidelines
| showDeveloperPermissionRequestNotice(result, () => { | ||
| void window.api.developerPermissions.openSettings({ id: 'local-network' }) | ||
| }) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Handle settings-open failures from the notice action.
This callback discards a rejected openSettings promise. The user receives no error notice, unlike DeveloperPermissionActions at lines 25-35. Catch the rejection here or pass a shared error-reporting settings opener.
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a93302e1-8f85-403e-a351-c82038c1cf26
📒 Files selected for processing (12)
src/main/ipc/developer-permissions.tssrc/main/ipc/local-network-connection-test.test.tssrc/main/ipc/local-network-connection-test.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/components/settings/DeveloperPermissionsPane.tsxsrc/renderer/src/components/settings/LocalNetworkConnectionTest.test.tsxsrc/renderer/src/components/settings/LocalNetworkConnectionTest.tsxsrc/renderer/src/components/settings/local-network-connection-history.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/web/web-preload-api.tssrc/shared/developer-permissions-types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/components/settings/DeveloperPermissionsPane.tsx
| const addressWithoutZone = host.split('%', 1)[0] ?? host | ||
| const kind = classifyRemotePairingHostname(addressWithoutZone) | ||
| if (isIP(addressWithoutZone) === 0) { | ||
| return kind === 'loopback' ? null : host | ||
| } | ||
| const isLinkLocalIpv4 = addressWithoutZone.startsWith('169.254.') | ||
| return kind === 'lan' || isLinkLocalIpv4 ? host : null |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Reject public hostnames before starting the connection test.
Line 79 accepts every non-IP hostname except loopback. A hostname such as example.com starts an outbound TCP connection before the child checks socket.remoteAddress. This violates the LAN-only target contract and exposes an external connection primitive through IPC.
Resolve the hostname first. Reject public addresses before opening a socket. Pin the accepted private or link-local address for the connection. Add a regression test that verifies a public hostname does not call runChild.
🧰 Tools
🪛 ast-grep (0.45.0)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile, type ExecFileException, type ExecFileOptions } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
| {translate( | ||
| 'auto.components.settings.DeveloperPermissionsPane.connectionTestLastVerified', | ||
| 'Last verified' | ||
| )}{' '} | ||
| {new Date(lastSuccess.testedAt).toLocaleString()} · {formatTarget(lastSuccess)} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Format the timestamp with the application locale.
toLocaleString() uses the system locale. Use getIntlLocale() so the saved verification time follows the selected application language.
Based on learnings: use getIntlLocale() for Intl APIs.
Source: Learnings
…3505) (stablyai#12833) * fix(permissions): surface macOS silent Local Network denial with diagnostic and workaround (STA-3505) On macOS 27 beta, NECP silently denies Orca's whole process tree Local Network access: no prompt fires, the app never appears in System Settings, and terminal child processes fail with EHOSTUNREACH. The Settings trigger swallowed the probe's socket error and reported 'unknown' + a 'Permission request sent' toast, indistinguishable from success. Classify the mDNS probe outcome (EHOSTUNREACH/EHOSTDOWN -> denied, clean send -> granted, else unknown), remember the verdict for the status chip, and render an inline diagnostic with the documented NECP re-evaluation workaround when denial is detected. * fix(permissions): avoid false Local Network grants * fix(permissions): use standard Local Network request flow * feat(permissions): add local network connection test * fix(permissions): nest local network connection test * fix(permissions): collapse connection test by default * fix(permissions): emphasize connection test action * fix(permissions): restore outlined connection action

Summary
Uses the supported macOS Local Network permission flow without claiming a permission state that macOS does not expose, and adds an explicit target-specific connection test.
STA-3505 reports a macOS 27 beta NECP defect that can silently deny the process tree. Orca cannot reliably introspect the OS permission toggle through a supported API, so the UI reports only a real target-specific connection result.
Screenshot
Electron QA exercised the real descendant-process test against a LAN TCP service and confirmed the saved result remains visible in a disclosure that is collapsed by default. Expanding it reveals the target form.
Testing
Platform scope
The request and connection-test handlers are macOS-gated. There is no polling, terminal hot-path work, remote-wire change, or mutation of SSH, folder-workspace, Git, or cross-platform behavior.