From 13a76efa052fb8f716708f08738c5c2249ae0b96 Mon Sep 17 00:00:00 2001 From: Stefan Dirix Date: Fri, 8 Nov 2024 17:28:23 +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;