auto-claude: subtask-2-2 - Update IPC handler to accept and pass images

Add images?: ImageAttachment[] parameter to INSIGHTS_SEND_MESSAGE handler
and pass it through to insightsService.sendMessage(). Also update the
service signature to accept the images parameter.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
AndyMik90
2026-02-17 15:32:37 +01:00
co-authored by Claude Opus 4.6
parent bca5efeb93
commit 1c1ca43b0c
2 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -3,7 +3,8 @@ import type {
InsightsSession,
InsightsSessionSummary,
InsightsChatMessage,
InsightsModelConfig
InsightsModelConfig,
ImageAttachment
} from '../shared/types';
import { InsightsConfig } from './insights/config';
import { InsightsPaths } from './insights/paths';
@@ -116,7 +117,8 @@ export class InsightsService extends EventEmitter {
projectId: string,
projectPath: string,
message: string,
modelConfig?: InsightsModelConfig
modelConfig?: InsightsModelConfig,
images?: ImageAttachment[]
): Promise<void> {
// Cancel any existing session
this.executor.cancelSession(projectId);
@@ -16,6 +16,7 @@ import type {
InsightsSession,
InsightsSessionSummary,
InsightsModelConfig,
ImageAttachment,
Task,
TaskMetadata,
AppSettings,
@@ -81,7 +82,7 @@ export function registerInsightsHandlers(getMainWindow: () => BrowserWindow | nu
ipcMain.on(
IPC_CHANNELS.INSIGHTS_SEND_MESSAGE,
async (_, projectId: string, message: string, modelConfig?: InsightsModelConfig) => {
async (_, projectId: string, message: string, modelConfig?: InsightsModelConfig, images?: ImageAttachment[]) => {
const project = projectStore.getProject(projectId);
if (!project) {
safeSendToRenderer(
@@ -112,7 +113,7 @@ export function registerInsightsHandlers(getMainWindow: () => BrowserWindow | nu
// the handler returns. This fixes race conditions on Windows where
// environment setup wouldn't complete before process spawn.
try {
await insightsService.sendMessage(projectId, project.path, message, configWithSettings);
await insightsService.sendMessage(projectId, project.path, message, configWithSettings, images);
} catch (error) {
// Errors during sendMessage (executor errors) are already emitted via
// the 'error' event, but we catch here to prevent unhandled rejection