Skip to content

Commit

Permalink
reviewed context
Browse files Browse the repository at this point in the history
  • Loading branch information
abeatrix committed Jan 3, 2025
1 parent f154507 commit 0787c6e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vscode/src/chat/agentic/DeepCody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,8 @@ export class DeepCodyAgent {
}

// 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))]
const reviewed = []
const validatedContext = PromptStringBuilder.extractTagContents(res, ACTIONS_TAGS.CONTEXT)
for (const contextName of validatedContext || []) {
const foundValidatedItems = this.context.filter(c => c.uri.path.endsWith(contextName))
for (const found of foundValidatedItems) {
Expand All @@ -228,6 +227,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
}

Expand Down Expand Up @@ -303,7 +303,8 @@ export class PromptStringBuilder {
this.parts = []
}

public static extractTagContents(response: string, tag: string): string[] {
public static extractTagContents(response: string, psTag: PromptString): string[] {
const tag = psTag.toString()
const tagLength = tag.length
return (
response
Expand Down

0 comments on commit 0787c6e

Please sign in to comment.