Skip to content

Commit 87d7c8a

Browse files
authored
make sure to not continue if is false for tool call images (#4807)
1 parent a25edaf commit 87d7c8a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/extension/prompts/node/panel/toolCalling.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,10 @@ class PrimitiveToolResult<T extends IPrimitiveToolResultProps> extends PromptEle
692692
}
693693

694694
protected async onImage(part: LanguageModelDataPart, _imageIndex?: number) {
695+
if (!this.endpoint.supportsVision) {
696+
return '[Image content is not available because vision is not supported by the current model or is disabled by your organization.]';
697+
}
698+
695699
const githubToken = (await this.authService.getGitHubSession('any', { silent: true }))?.accessToken;
696700
const uploadsEnabled = this.configurationService && this.experimentationService
697701
? this.configurationService.getExperimentBasedConfig(ConfigKey.EnableChatImageUpload, this.experimentationService)

0 commit comments

Comments
 (0)