diff --git a/packages/ai-core/src/browser/frontend-prompt-customization-service.ts b/packages/ai-core/src/browser/frontend-prompt-customization-service.ts index d970f5c522a57..6ffe3969df378 100644 --- a/packages/ai-core/src/browser/frontend-prompt-customization-service.ts +++ b/packages/ai-core/src/browser/frontend-prompt-customization-service.ts @@ -116,6 +116,10 @@ export class FrontendPromptCustomizationServiceImpl implements PromptCustomizati })); this.onDidChangeCustomAgentsEmitter.fire(); + + if (!(await this.fileService.exists(templateURI))) { + return; + } const stat = await this.fileService.resolve(templateURI); if (stat.children === undefined) { return;