Repository navigation
refactor(ipc): import ipc helpers from their owning modules, not re-export shims - #30369
Conversation
…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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
…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.
ELI5
Eleven files in
src/main/ipcpartly 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
ipc/local-agent-install-dir-detection.ts,notification-burst-cooldown.ts,terminal-git-credential-guard.tsandtui-agent-detection-commands.ts. The last was anexport *fromshared/.export {…} from,export * from, andexport type * from) in:feedback-image-attachments,feedback-requestparcel-watcher-process,pluginspty-pending-data-drain-queue,pty/host-env/pi-agentruntime-watcher-process-poolipc,preflight,plugins,notifications,runtimeandagent-hooks, merging duplicate imports where needed.ipc/local-agent-install-dir-detectionpath, so after the rewrite their mocks no longer reached the code under test. They now mockshared/local-agent-install-dir-detection. Two of the three tests failed until this was fixed.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
ipcmodules re-export names that existing test mocks depend on:filesystem-auth,filesystem-watcher,markdown-documents,preflight,runtime-environment-transport-routing,worktree-base-directory-pollerandworktree-logic. They get a separate PR so this one stays mechanical.dashboard-payload-validationis 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,notificationsandagent-hooks, plus every changed test file, single worker: 718 files and 6,961 tests, all passing.src/cli/skills.test.tsandruntime/file-watcher-host.test.tsalso pass.