110
}
111
113
>
toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized,
114
>
readFile: (uri: URI) => Promise<VSBuffer>
115
>
): Promise<IChatExtractedImage[]> {
116
>
// Use pastTenseMessage if available, otherwise fall back to invocationMessage.
117
>
// When pastTenseMessage exists it visually replaces invocationMessage in the UI,
118
>
// so we only look at its URIs — we don't fall back to invocationMessage URIs.
119
>
const message = toolInvocation.pastTenseMessage ?? toolInvocation.invocationMessage;
120
>
if (!message || typeof message === 'string' || !message.uris || Object.keys(message.uris).length === 0) {
121
return [];
122
}