Skip to content

fix(desktop): declare local network usage on macOS - #65355

Closed
Aj002Th wants to merge 1 commit into
anomalyco:devfrom
Aj002Th:desktop-local-network
Closed

Aj002Th wants to merge 1 commit into
anomalyco:devfrom
Aj002Th:desktop-local-network

Conversation

@Aj002Th

@Aj002Th Aj002Th commented Nov 21, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #63815

Type of change

  • Bug fix

What does this PR do?

On macOS 15 and later, reaching a self-hosted server or an SSH host on the LAN is gated by the Local Network privacy privilege. OpenCode Desktop never appears in System Settings → Privacy & Security → Local Network, and macOS never asks.

The app declares no NSLocalNetworkUsageDescription. nehelper refuses to prompt an app that provides no usage string (its message is App did not provide a local network usage string, not prompting), which matches the missing alert and the missing entry in Settings in the report. Apple's TN3179 asks every app that touches the local network to include the key.

This adds the description to mac.extendInfo (English source string only; other locales keep the English fallback) and inserts the same key into the development Electron bundle, so the prompt can be reproduced with bun run dev:desktop.

Note for the release: on macOS before 27.2 there is no way to reset an app's Local Network decision, so a user who already lost the prompt needs macOS 27.2's remove button or a fresh user account after this ships.

How did you verify your code works?

  • bun test electron-builder.config.test.ts in packages/desktop: the existing macOS channel table now asserts a non-empty NSLocalNetworkUsageDescription for dev, beta and prod.
  • bun test src/runtime/i18n/desktop-native.test.ts in packages/app, and bun typecheck in both packages, pass.
  • bun run pack on macOS then plutil -p "dist/mac-arm64/OpenCode Dev.app/Contents/Info.plist" shows the new key in the built bundle.
  • The runtime alert needs a Developer ID signed build, which I cannot produce here. To confirm on a Mac: install a build with this change, add a server at a LAN address such as http://192.168.1.1:9, and check that the Local Network alert names OpenCode and that OpenCode then shows up in Settings → Privacy & Security → Local Network.

Screenshots / recordings

No UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Nov 21, 2026

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct and is as small as it should be: it adds NSLocalNetworkUsageDescription to the packaged macOS app and to the dev Electron bundle, which matches Apple's guidance (TN3179) for apps that reach LAN hosts. I couldn't check the actual prompt, which needs macOS. The desktop builder config tests and the desktop-native i18n tests pass, and tsc -b in packages/desktop is clean. It would help if someone with a Mac confirmed that the Local Network alert appears and that OpenCode shows up in Privacy & Security after adding a LAN server or SSH host.

Public API: unchanged. Only the app bundle's Info.plist and an internal desktop string change.

One thing to coordinate: #63679 (mDNS phone pairing) adds the same plist key and the same desktop.localNetworkUsage string name, but its text is about pairing only. Whichever PR merges second needs one description that covers LAN/SSH servers and pairing, because the bundle can only have one.

Related: #58080, #63820

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Aj002Th Aj002Th closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant