Skip to content

Commit 48c3cbb

Browse files
authored
Remove unused ToolName import and simplify todo context rendering (#1193)
* Remove unused ToolName import and simplify todo context rendering * Update todo list context validation to check for 'No todo list found.' message
1 parent 95b1bbf commit 48c3cbb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/extension/prompt/node/todoListContextProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class TodoListContextProvider implements ITodoListContextProvider {
3838
.map(part => part.value)
3939
.join('\n');
4040

41-
if (!todoList.trim()) {
41+
if (!todoList.trim() || todoList === 'No todo list found.') {
4242
return undefined;
4343
}
4444

src/extension/tools/node/todoListContextPrompt.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { BasePromptElementProps, PromptElement } from '@vscode/prompt-tsx';
77
import { ITodoListContextProvider } from '../../prompt/node/todoListContextProvider';
88
import { Tag } from '../../prompts/node/base/tag';
9-
import { ToolName } from '../common/toolNames';
109

1110
export interface TodoListContextPromptProps extends BasePromptElementProps {
1211
sessionId?: string;
@@ -29,9 +28,12 @@ export class TodoListContextPrompt extends PromptElement<TodoListContextPromptPr
2928
return null;
3029
}
3130
const todoContext = await this.todoListContextProvider.getCurrentTodoContext(sessionId);
31+
if (!todoContext) {
32+
return null;
33+
}
3234
return (
3335
<Tag name="todoList">
34-
{todoContext || <>Empty todo list. Call `{ToolName.CoreManageTodoList}` to set todos as needed.</>}
36+
{todoContext}
3537
</Tag>
3638
);
3739
}

0 commit comments

Comments
 (0)