fix: address plugin bridge review comments from PR #9889#9938
Conversation
- rename plugin-ui-* IPC channels to plugins.ui* for naming consistency - add sender validation to plugins.uiPromptResult handler - use invokePluginBridgeMethod for getBridgeMetrics (adds it to PluginInvokeMethod) - use window.main.plugins.executePluginMainAction in root.tsx instead of direct import - use servicesProxy instead of servicesNodeImpl in plugin window entry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR follows up on PR #9889 by tightening the plugin-bridge IPC surface: it standardizes plugin UI IPC channel names, adds sender validation for prompt results, routes getBridgeMetrics through the same preload bridge helper, switches plugin-window service initialization to the IPC proxy, and updates an OAuth flow to call plugin main actions via the bridge.
Changes:
- Renamed plugin UI IPC channels to
plugins.ui*dot-notation and updated corresponding type unions and listeners. - Added
event.sender === mainWindow.webContentsvalidation forplugins.uiPromptResult. - Routed plugin-window service calls through
servicesProxyand normalizedgetBridgeMetricsinvocation viainvokePluginBridgeMethod.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/insomnia/src/ui/renderer-listeners.ts | Updates renderer listeners to new plugins.ui* IPC channel names. |
| packages/insomnia/src/root.tsx | Switches Azure OAuth exchange to use the plugin bridge call site. |
| packages/insomnia/src/plugins/invoke-method.ts | Extends PluginInvokeMethod with getBridgeMetrics. |
| packages/insomnia/src/main/plugin-window.ts | Renames plugin UI channels and adds sender validation for prompt results. |
| packages/insomnia/src/main/ipc/electron.ts | Updates IPC channel type unions to match the new channel names. |
| packages/insomnia/src/entry.preload.ts | Uses invokePluginBridgeMethod('getBridgeMetrics') and renames prompt-result send channel. |
| packages/insomnia/src/entry.plugin-window.ts | Initializes services using servicesProxy instead of the node implementation bundle. |
| packages/insomnia/src/entry.plugin-window-preload.ts | Renames plugin UI bridge channels used by the plugin window. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ Circular References ReportGenerated at: 2026-05-21T07:46:53.416Z Summary
Click to view all circular references in PR (19)Click to view all circular references in base branch (19)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
- Remove getBridgeMetrics from PluginInvokeMethod since it is handled by the main process directly and has no case in invokePluginMethod() - Route getBridgeMetrics in preload via ipcRenderer.invoke directly - Use plugins.executePluginMainAction in root.tsx to respect the INSOMNIA_ENABLE_PLUGIN_BRIDGE rollback switch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename plugin-invoke → plugins.invoke to match the plugins.* dot-notation used by all other plugin IPC channels introduced in PR #9889. Also add the missing plugin handle channels to the HandleChannels type union in electron.ts (getBridgeMetrics, hasRequestHooks, hasResponseHooks, applyRequestHooks, applyResponseHooks). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Addresses the review comments left on #9889 after merge.
plugin-ui-alert,plugin-ui-dialog,plugin-ui-prompt,plugin-ui-prompt-resulttoplugins.uiAlert,plugins.uiDialog,plugins.uiPrompt,plugins.uiPromptResultto match theplugins.xxxdot-notation pattern used by all other plugin bridge channelsevent.sender !== mainWindow.webContentsguard to theplugins.uiPromptResultIPC handler (the prompt result originates from the main renderer window, not the plugin window)getBridgeMetricsconsistency — switched from rawinvokeWithNormalizedError('plugins.getBridgeMetrics')toinvokePluginBridgeMethod('getBridgeMetrics')and added'getBridgeMetrics'toPluginInvokeMethodexecutePluginMainActionin root.tsx — replaced directexecutePluginMainActionimport from~/pluginswithwindow.main.plugins.executePluginMainAction(the bridge)servicesProxyin plugin window — replacedservicesNodeImplwithservicesProxyinentry.plugin-window.tsso service calls route through IPC to the main process rather than importing the Node.js implementation bundle directlyTest plan
tsc --noEmit)🤖 Generated with Claude Code