From eb73c687401a68977eb3b47b20344ce5085181a8 Mon Sep 17 00:00:00 2001 From: Beatrix Date: Fri, 3 Jan 2025 04:09:54 -0800 Subject: [PATCH] reviewed context --- vscode/src/chat/agentic/DeepCody.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vscode/src/chat/agentic/DeepCody.ts b/vscode/src/chat/agentic/DeepCody.ts index d8ecc89dde09..63f857fca836 100644 --- a/vscode/src/chat/agentic/DeepCody.ts +++ b/vscode/src/chat/agentic/DeepCody.ts @@ -215,11 +215,11 @@ export class DeepCodyAgent { } } + const reviewed = [] + // Extract all the strings from between tags. - const contextListTag = ACTIONS_TAGS.CONTEXT.toString() - const validatedContext = PromptStringBuilder.extractTagContents(res, contextListTag) - const reviewed = [...this.context.filter(c => isUserAddedItem(c))] - for (const contextName of validatedContext || []) { + const valid = PromptStringBuilder.extractTagContents(res, ACTIONS_TAGS.CONTEXT.toString()) + for (const contextName of valid || []) { const foundValidatedItems = this.context.filter(c => c.uri.path.endsWith(contextName)) for (const found of foundValidatedItems) { reviewed.push({ ...found, source: ContextItemSource.Agentic }) @@ -228,6 +228,7 @@ export class DeepCodyAgent { // Replace the current context list with the reviewed context. if (reviewed.length) { + reviewed.push(...this.context.filter(c => isUserAddedItem(c))) this.context = reviewed }