Skip to content

Commit 8151655

Browse files
authored
Filter out tasks without type or with hide to align with prompt agent context (microsoft#258243)
update
1 parent 5412b3c commit 8151655

File tree

1 file changed

+6
-1
lines changed
  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task

1 file changed

+6
-1
lines changed

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/taskHelpers.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,16 @@ export async function getTaskForTool(id: string | undefined, taskDefinition: { t
3838
let task: IConfiguredTask | undefined;
3939
const configTasks: IConfiguredTask[] = (configurationService.getValue('tasks') as { tasks: IConfiguredTask[] }).tasks ?? [];
4040
for (const configTask of configTasks) {
41+
if (!configTask.type || 'hide' in configTask && configTask.hide) {
42+
// Skip thse as they
43+
// and not included in the agent prompt.
44+
continue;
45+
}
4146
if ((configTask.type && taskDefinition.taskType ? configTask.type === taskDefinition.taskType : true) &&
4247
((getTaskRepresentation(configTask) === taskDefinition?.taskLabel) || (id === configTask.label))) {
4348
task = configTask;
4449
break;
45-
} else if (id === `${configTask.type}: ${index}`) {
50+
} else if (!configTask.label && id === `${configTask.type}: ${index}`) {
4651
task = configTask;
4752
break;
4853
}

0 commit comments

Comments
 (0)