Skip to content

Fix ssh watcher isolation - #8463

Merged
AmethystLiang merged 2 commits into
mainfrom
fix-ssh-watcher-isolation
Jul 13, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
fix-ssh-watcher-isolation

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

Describe the user-visible change.

Screenshots

  • Add screenshots or a screen recording for any new or changed UI behavior.
  • If there is no visual change, say No visual change.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

AI Review Report

Summarize the code review you ran with your AI coding agent. Include the main risks it checked, what it flagged, and what you changed or verified as a result.
Confirm that the review explicitly checked cross-platform compatibility for macOS, Linux, and Windows, including shortcuts, labels, paths, shell behavior, and any Electron-specific platform differences touched by this PR.

Security Audit

Provide a basic security audit summary from your AI coding agent. Call out any input handling, command execution, path handling, auth, secrets, dependency, or IPC risks that were reviewed, plus any follow-up needed.

Notes

Call out any platform-specific behavior, risks, or follow-up work.

- Use exclusive ('wx') creation for the fault-harness pid file so a leaked
  ORCA_WATCHER_CHILD_PID_FILE env var can't clobber an existing file, and
  have the harness remove the file after reading a replacement pid.
- Force useInProcessVitestFallback to false in the relay watcher pool so a
  leaked VITEST env var can never load the native watcher addon in-process
  on the relay; fail closed instead when the isolated child is missing.
- Thread an injectable RelayWatcherProcessPool into FsHandler/
  RelayFilesystemWatchRegistry for tests, and add coverage for both fixes.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d5ed0988-8379-446d-922c-e0e908cbe1ca

📥 Commits

Reviewing files that changed from the base of the PR and between 8abe093 and af9165d.

📒 Files selected for processing (22)
  • .github/workflows/release-cut.yml
  • .github/workflows/release-mac-build.yml
  • config/reliability-gates.jsonc
  • config/scripts/build-relay.mjs
  • config/scripts/package-electron-runtime-contract.test.mjs
  • config/scripts/relay-watcher-fault-harness.mjs
  • src/main/ipc/parcel-watcher-child-launch.ts
  • src/main/ipc/parcel-watcher-host-subscriptions.ts
  • src/main/ipc/parcel-watcher-process-failure.ts
  • src/main/ipc/parcel-watcher-process-supervisor-options.ts
  • src/main/ipc/parcel-watcher-process-supervisor.ts
  • src/main/ipc/parcel-watcher-process.test.ts
  • src/main/ipc/parcel-watcher-supervisor-subscribe.ts
  • src/main/ssh/ssh-relay-versioned-install.test.ts
  • src/main/ssh/ssh-relay-versioned-install.ts
  • src/main/ssh/ssh-remote-commands.ts
  • src/relay/fs-handler.test.ts
  • src/relay/fs-handler.ts
  • src/relay/relay-filesystem-watch-registry.test.ts
  • src/relay/relay-filesystem-watch-registry.ts
  • src/relay/relay-watcher-process-pool.ts
  • src/relay/subprocess.test.ts

📝 Walkthrough

Walkthrough

The change adds a separately bundled relay-watcher.js artifact and includes it in relay version hashing and SSH installation checks. Relay filesystem watching now uses a shared watch registry and configurable watcher process pool with recovery, client coordination, and cleanup behavior. A fault harness validates watcher replacement while relay, PTY, and filesystem events continue operating. Reliability configuration and Linux/macOS release workflows now execute the relay watcher isolation gate, with packaging and installation contract tests covering the new artifact.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is only the template text and lacks actual summary, testing, review, security, and notes content. Fill in each required section with concrete details, including the change summary, screenshots/no visual change, test results, AI review, security audit, and notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 4.17% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change: SSH watcher isolation hardening.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang merged commit e3c47ef into main Jul 13, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(ssh): isolate relay filesystem watchers

* Fix relay watcher fault-harness pid file and in-process fallback isolati

- Use exclusive ('wx') creation for the fault-harness pid file so a leaked
  ORCA_WATCHER_CHILD_PID_FILE env var can't clobber an existing file, and
  have the harness remove the file after reading a replacement pid.
- Force useInProcessVitestFallback to false in the relay watcher pool so a
  leaked VITEST env var can never load the native watcher addon in-process
  on the relay; fail closed instead when the isolated child is missing.
- Thread an injectable RelayWatcherProcessPool into FsHandler/
  RelayFilesystemWatchRegistry for tests, and add coverage for both fixes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant