@@ -25,6 +25,7 @@ import {
2525 type ProcessTimeoutControl ,
2626 type ProcessTimeoutInfo ,
2727 type PluginRateLimitedTool ,
28+ type SharpLoader ,
2829 type ToolCallExecution ,
2930 type ToolExecutionHooks ,
3031 type ToolExecutionFollowUpMessage ,
@@ -353,6 +354,7 @@ export type SessionManagerOptions = {
353354 onLlmStreamProgress ?: ( progress : LlmStreamProgress ) => void ;
354355 onMcpStatusChanged ?: ( ) => void ;
355356 onProcessStdout ?: ( pid : number , chunk : string ) => void ;
357+ loadSharp ?: SharpLoader ;
356358 nonInteractive ?: boolean ;
357359} ;
358360
@@ -404,7 +406,7 @@ export class SessionManager {
404406 this . onMcpStatusChanged = options . onMcpStatusChanged ;
405407 this . onProcessStdout = options . onProcessStdout ;
406408 this . nonInteractive = options . nonInteractive === true ;
407- this . toolExecutor = new ToolExecutor ( this . projectRoot , this . createOpenAIClient , this . mcpManager ) ;
409+ this . toolExecutor = new ToolExecutor ( this . projectRoot , this . createOpenAIClient , this . mcpManager , options . loadSharp ) ;
408410 this . mcpManager . prepare ( this . getResolvedSettings ( ) . mcpServers ) ;
409411 this . messageConverter = new OpenAIMessageConverter ( {
410412 renderInitPrompt : ( ) => this . renderInitCommandPrompt ( ) ,
@@ -2869,7 +2871,7 @@ ${agentInstructions}
28692871
28702872 const value = args [ firstKey ] ;
28712873 const text = typeof value === "string" ? value : JSON . stringify ( value ) ;
2872- if ( toolName === "read" && text . startsWith ( this . projectRoot ) ) {
2874+ if ( ( toolName === "read" || toolName === "ReadImage" ) && text . startsWith ( this . projectRoot ) ) {
28732875 return text . slice ( this . projectRoot . length ) . replace ( / ^ [ \\ / ] / , "" ) ;
28742876 }
28752877 return text ;
0 commit comments