Repository navigation
Conversation
There was a problem hiding this comment.
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.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Issue for this PR
Closes #63815
Type of change
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.nehelperrefuses to prompt an app that provides no usage string (its message isApp 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 withbun 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.tsinpackages/desktop: the existing macOS channel table now asserts a non-emptyNSLocalNetworkUsageDescriptionfor dev, beta and prod.bun test src/runtime/i18n/desktop-native.test.tsinpackages/app, andbun typecheckin both packages, pass.bun run packon macOS thenplutil -p "dist/mac-arm64/OpenCode Dev.app/Contents/Info.plist"shows the new key in the built bundle.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