Skip to content

fix: pr-bug-scan validated finding from #2835 - #2873

Merged
nwparker merged 2 commits into
mainfrom
bot/pr-bug-scan-2835-1779851181
May 31, 2026
Merged

nwparker merged 2 commits into
mainfrom
bot/pr-bug-scan-2835-1779851181

Conversation

@buf0-bot

@buf0-bot buf0-bot Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Automated fix-PR from pr-bug-scan for parent #2835.

Fixer status: FIXED_WITH_CODE_PROOF
Summary:
Blocked proof link: src/main/network/macos-system-resolver-health.ts:24 — spawnSync('/usr/sbin/scutil', ['--dns'], { timeout: 1500 }) blocks the daemon's single-threaded Node event loop
Typecheck: ?

Proof (from validator)

  • C1 — proof_type: code_analysis
    • trigger: User opens a new terminal tab on macOS (isNewSession=true), or daemon-init runs the reuse check on app launch.
    • observable: All other PTYs hosted by the same daemon experience a stall in stdout fanout and input handling each time a new tab is opened on macOS; under scutil stall the freeze can extend to the 1500ms timeout.
    • path:
      • src/main/daemon/daemon-pty-adapter.ts:104 doSpawn → replaceUnhealthyMacResolverDaemonBeforeNewPty when opts.isNewSession is true
      • src/main/daemon/daemon-health.ts:getMacDaemonSystemResolverHealth issues 'systemResolverHealth' RPC to the daemon
      • src/main/daemon/daemon-server.ts:313 case 'systemResolverHealth' calls readCurrentProcessMacSystemResolverHealth() synchronously inside routeRequest
      • src/main/network/macos-system-resolver-health.ts:24 spawnSync('/usr/sbin/scutil', ['--dns'], { timeout: 1500 }) blocks the daemon's single-threaded Node event loop

Generated by pr-bug-scan (proof-machine architecture). Human approval required before merge.

Risk assessment

Risk: HIGH

Historic risk metadata backfill based on the existing risk:high label.

Risk: high

Historic risk metadata backfill based on the existing risk:high label.

@AmethystLiang
AmethystLiang requested a review from nwparker May 27, 2026 03:58
@nwparker

Copy link
Copy Markdown
Contributor

Coordinator evidence update: I took over this PR under the current non-team and newer-than-2026-05-01 scope. The bug-scan finding is valid: the macOS resolver-health daemon RPC path used synchronous scutil, which could block daemon PTY RPC/stdout handling.

Pushed follow-up commit 029fb2adb339c658bcd34ac644333a2d063cb3c0 to tighten async timeout behavior and add focused regression coverage.

Evidence:

  • pnpm exec vitest run --config config/vitest.config.ts src/main/network/macos-system-resolver-health.test.ts src/main/daemon/daemon-server.test.ts: 21 tests passed.
  • pnpm run typecheck:node: passed.
  • pnpm exec oxlint src/main/network/macos-system-resolver-health.ts src/main/network/macos-system-resolver-health.test.ts: 0 errors.
  • git diff --check: passed.
  • Local merge-tree against origin/main: clean.
  • New tests prove the event loop remains free while scutil is pending, timeout resolves unknown and kills the child at 1500ms, and non-macOS paths fail open without spawning scutil.
  • gh pr checks 2873 --repo stablyai/orca --watch --interval 10: verify passed in 5m26s.

No merge performed.

@nwparker nwparker added the risk:high High risk change label May 30, 2026
@nwparker
nwparker merged commit 4d2c041 into main May 31, 2026
1 check passed
@nwparker
nwparker deleted the bot/pr-bug-scan-2835-1779851181 branch May 31, 2026 08:41
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix: address pr-bug-scan validated finding from stablyai#2835

* test: cover async macOS resolver health check

---------

Co-authored-by: orca-bug-scan-bot <[email protected]>
Co-authored-by: Neil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high High risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant