From 6c76b447279226195f765126d1cfb2c5280c6957 Mon Sep 17 00:00:00 2001 From: Stefan Dirix Date: Fri, 8 Nov 2024 20:11:06 +0100 Subject: [PATCH] fix: avoid prompt template directory error The prompt customization service tried to access the prompt template directory even if it did not exist (yet). This case is now checked. Fixes #14367 --- .../src/browser/frontend-prompt-customization-service.ts | 4 ++++ 1 file changed, 4 insertions(+) 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;