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 eb73c68
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 @@ -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 })
Expand All @@ -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
}

Expand Down

0 comments on commit eb73c68

Please sign in to comment.