Skip to content

refactor(ipc): import ipc helpers from their owning modules, not re-export shims - #30369

Merged
nwparker merged 1 commit into
mainfrom
nwparker/r2-debarrel-ipc
Oct 18, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/r2-debarrel-ipc

Conversation

@nwparker

@nwparker nwparker commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37 $\color{#cf222e}{\Huge{\mathbf{−}}}$​37 0
Prod 24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​27 $\color{#cf222e}{\Huge{\mathbf{−}}}$​64 $\color{#cf222e}{\Huge{\mathbf{−}}}$​37

ELI5

Eleven files in src/main/ipc partly or entirely forwarded exports that live in other files. This PR changes the code to import each name from the file that defines it and removes the forwarding. Nothing the app does changes.

What Changed

  • Deleted pure re-export modules: ipc/local-agent-install-dir-detection.ts, notification-burst-cooldown.ts, terminal-git-credential-guard.ts and tui-agent-detection-commands.ts. The last was an export * from shared/.
  • Removed re-export lines (export {…} from, export * from, and export type * from) in:
    • feedback-image-attachments, feedback-request
    • parcel-watcher-process, plugins
    • pty-pending-data-drain-queue, pty/host-env/pi-agent
    • runtime-watcher-process-pool
  • Updated importers across ipc, preflight, plugins, notifications, runtime and agent-hooks, merging duplicate imports where needed.
  • Updated test mocks. Three tests mocked the deleted ipc/local-agent-install-dir-detection path, so after the rewrite their mocks no longer reached the code under test. They now mock shared/local-agent-install-dir-detection. Two of the three tests failed until this was fixed.
  • Size: production +27/−64, tests +37/−37.

Why

The user's rule is that there are no barrel or re-export modules. These files hide which module owns a function and give a function two import paths. As those mocks showed, that lets a test mock the wrong path without noticing.

Seven more ipc modules re-export names that existing test mocks depend on: filesystem-auth, filesystem-watcher, markdown-documents, preflight, runtime-environment-transport-routing, worktree-base-directory-poller and worktree-logic. They get a separate PR so this one stays mechanical. dashboard-payload-validation is skipped because open PRs #30145, #29953 and #28445 edit it.

Linked Issue

N/A (SSH hardening round 2, de-barrel follow-up).

Visual Proof

N/A: an import-only refactor.

Testing

  • typecheck:ci: clean.
  • src/main/ipc, plugins, preflight, notifications and agent-hooks, plus every changed test file, single worker: 718 files and 6,961 tests, all passing. src/cli/skills.test.ts and runtime/file-watcher-host.test.ts also pass.
  • Full local "static analysis and typecheck" job: clean.
  • Codex review (gpt-6.1-sol, high): clean.

…xport shims

Deletes local-agent-install-dir-detection, notification-burst-cooldown, terminal-git-credential-guard
and tui-agent-detection-commands (pure re-export modules) and the re-export lines in seven more
ipc modules; importers and test mocks name the real modules.
@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 859494c5-f91a-4101-adf9-442a8222a665
📥 Commits

Reviewing files that changed from the base of the PR and between 1938bd0 and ad9b1a3.

📒 Files selected for processing: 40
  • src/main/agent-hooks/managed-hook-detection-commands.ts
  • src/main/ipc/feedback-image-attachments.test.ts
  • src/main/ipc/feedback-image-attachments.ts
  • src/main/ipc/feedback-request.ts
  • src/main/ipc/feedback.test.ts
  • src/main/ipc/feedback.ts
  • src/main/ipc/freebuff-detection.test.ts
  • src/main/ipc/local-agent-install-dir-detection.ts
  • src/main/ipc/notification-burst-cooldown.ts
  • src/main/ipc/parcel-watcher-process.ts
  • src/main/ipc/parcel-watcher-root-path-rewrite.test.ts
  • src/main/ipc/plugins.ts
  • src/main/ipc/preflight-agent-detection-no-subprocess.test.ts
  • src/main/ipc/pty-pending-data-drain-queue-differential.test.ts
  • src/main/ipc/pty-pending-data-drain-queue.test.ts
  • src/main/ipc/pty-pending-data-drain-queue.ts
  • src/main/ipc/pty-pending-data-drain-scheduler-differential.test.ts
  • src/main/ipc/pty/delivery/accounting.ts
  • src/main/ipc/pty/delivery/flush.ts
  • src/main/ipc/pty/delivery/pending.ts
  • src/main/ipc/pty/host-env/assembly.ts
  • src/main/ipc/pty/host-env/opencode-config.ts
  • src/main/ipc/pty/host-env/pi-agent.ts
  • src/main/ipc/pty/session.ts
  • src/main/ipc/qoder-desktop-execution-host.test.ts
  • src/main/ipc/runtime-watcher-process-pool.ts
  • src/main/ipc/terminal-git-credential-guard.test.ts
  • src/main/ipc/terminal-git-credential-guard.ts
  • src/main/ipc/tui-agent-detection-commands.test.ts
  • src/main/ipc/tui-agent-detection-commands.ts
  • src/main/ipc/worktree-git-common-watch-reconciliation.test.ts
  • src/main/notifications/notification-delivery-service.ts
  • src/main/plugins/plugin-dev-watcher-unknown-identity.test.ts
  • src/main/plugins/plugin-dev-watcher.test.ts
  • src/main/plugins/plugin-dev-watcher.ts
  • src/main/preflight/agent-command-detection.test.ts
  • src/main/preflight/agent-command-detection.ts
  • src/main/preflight/agent-detection.ts
  • src/main/runtime/file-watcher-host.test.ts
  • src/main/runtime/file-watcher-host.ts
💤 Files with no reviewable changes: 11
  • src/main/ipc/runtime-watcher-process-pool.ts
  • src/main/ipc/terminal-git-credential-guard.ts
  • src/main/ipc/notification-burst-cooldown.ts
  • src/main/ipc/tui-agent-detection-commands.ts
  • src/main/ipc/pty/host-env/pi-agent.ts
  • src/main/ipc/local-agent-install-dir-detection.ts
  • src/main/ipc/pty-pending-data-drain-queue.ts
  • src/main/ipc/feedback-request.ts
  • src/main/ipc/plugins.ts
  • src/main/ipc/feedback-image-attachments.ts
  • src/main/ipc/parcel-watcher-process.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

Imports now reference the shared utility modules and dedicated contract modules that define the imported values and types. The change removes several IPC re-exports and updates affected implementation files and tests. The summaries show no runtime behavior changes.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to ad9b1

This is an import-boundary refactor with no identified behavior regression, and the reported typecheck and test runs passed. No concrete PR risk remains beyond normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 29 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: importing IPC helpers from their owning modules instead of re-export shims.
Description check Passed The description covers the core template sections, including the plain-language summary, changes, rationale, linked-issue status, visual proof, and testing. It omits the Review, Agent skill upstream b…
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.
Full details: Description check

Explanation

The description covers the core template sections, including the plain-language summary, changes, rationale, linked-issue status, visual proof, and testing. It omits the Review, Agent skill upstream boundary, Notes, and Checklist sections, but the main change and verification details are clear.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@nwparker
nwparker merged commit e1b2d58 into main Oct 18, 2026
34 checks passed
frbarbre added a commit to frbarbre/orca that referenced this pull request Oct 18, 2026
…tup split

Upstream dropped the watcher type re-exports from parcel-watcher-process.ts
(stablyai#30369) and the setupScriptLaunchMode setting (stablyai#29819: setup always gets its
own tab), so the language-server watcher imports the owning modules and the
fork's background-terminal launcher no longer splits setup into a pane.
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