orca icon indicating copy to clipboard operation
orca copied to clipboard

PTY terminals spawn outside gui/$UID launchd domain — system DNS resolution fails

Open dragonfire1119 opened this issue 6 months ago • 2 comments

Bug Report

Hostname resolution fails in newly-spawned Orca terminals because the long-lived Orca daemon loses access to the macOS system resolver (mDNSResponder) over its lifetime. PTYs it spawns afterward cannot resolve hostnames.

Behavior:

  • ping google.com → cannot resolve google.com: Unknown host in a newly-spawned Orca terminal
  • ping 1.1.1.1 works (network is fine, only name resolution breaks)
  • dig / nslookup still work (they hit a nameserver directly over UDP, bypassing the system resolver)
  • Affects any tool using the system resolver: ping, curl/git over https hostnames, package managers
  • Terminals that were spawned earlier in the session keep working; only newly-spawned ones break
  • Quitting and relaunching Orca does NOT fix it

Diagnosis: In a broken (newly-spawned) terminal:

  • scutil --dns → No DNS configuration available
  • dscacheutil -q host -a name google.com → no output
  • dig google.com → resolves fine

The PTY parent for both working and broken shells is the same daemon process:

/Applications/Orca.app/Contents/Frameworks/Orca Helper.app/Contents/MacOS/Orca Helper \
  .../out/main/daemon-entry.js --socket .../orca/daemon/daemon-v7.sock --token .../daemon-v7.token

That daemon runs with PPID 1 (detached from the GUI login session) and outlives the app. Shells it spawns early still resolve DNS; shells spawned later (identical env / PATH / PPID / /bin/zsh -l) cannot. The daemon appears to lose its mDNSResponder / SCDynamicStore connection over its lifetime, and every PTY spawned after that inherits the broken state.

buildPtyEnv env construction is not the cause — no DNS/resolver env vars are touched.

Workaround that fixes it: kill the daemon and relaunch Orca so a fresh daemon spawns:

kill $(pgrep -f 'daemon-entry.js --socket')

After that, newly-spawned terminals resolve DNS correctly.

Environment:

  • macOS 26.5 (25F71), Apple Silicon
  • Orca 1.4.28-rc.4 (also reproduced on 1.4.28-rc.0)
  • App not quarantined; no sandbox entitlements on the binary

dragonfire1119 avatar May 25 '26 20:05 dragonfire1119

@nwparker thank you for making a pr for this. I'm on version 1.4.30 and this still happens. Killing the daemon (kill $(pgrep -f 'daemon-entry.js --socket')) fixes it temporarily until the daemon degrades again.

dragonfire1119 avatar May 27 '26 15:05 dragonfire1119

still happened on v1.4.119 (with PPID 1 (detached from the GUI login session) environment) and the temporary fix (kill $(pgrep -f 'daemon-entry.js --socket') ) works well

minho-pinta-sh avatar Jul 03 '26 03:07 minho-pinta-sh