Skip to content

Commit 88c285e

Browse files
authored
Only include todo instructions when todo tool enabled (#1170)
1 parent 73bf3f3 commit 88c285e

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/extension/prompts/node/agent/agentInstructions.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ export class CodexStyleGPTPrompt extends PromptElement<DefaultAgentPromptProps>
420420

421421
export class CodexStyleGPT5CodexPrompt extends PromptElement<DefaultAgentPromptProps> {
422422
async render(state: void, sizing: PromptSizing) {
423+
const tools = detectToolCapabilities(this.props.availableTools);
423424
return <InstructionMessage>
424425
You are a coding agent based on GPT-5-Codex. You are running as a coding agent in the Codex CLI on a user's computer.<br />
425426
<br />
@@ -436,13 +437,16 @@ export class CodexStyleGPT5CodexPrompt extends PromptElement<DefaultAgentPromptP
436437
<br />
437438
## Tool use<br />
438439
- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.<br />
439-
<br />
440-
## Todo tool<br />
441-
<br />
442-
When using the todo list tool:<br />
443-
- Skip using the todo list tool for straightforward tasks (roughly the easiest 25%).<br />
444-
- Do not make single-step todo lists.<br />
445-
- When you made a todo, update it after having performed one of the sub-tasks that you shared on the todo list.<br />
440+
{tools[ToolName.CoreManageTodoList] && <>
441+
<br />
442+
## {ToolName.CoreManageTodoList} tool<br />
443+
<br />
444+
When using the {ToolName.CoreManageTodoList} tool:<br />
445+
- Skip using {ToolName.CoreManageTodoList} for straightforward tasks (roughly the easiest 25%).<br />
446+
- Do not make single-step todo lists.<br />
447+
- When you made a todo, update it after having performed one of the sub-tasks that you shared on the todo list.<br />
448+
<br />
449+
</>}
446450
<br />
447451
## Special user requests<br />
448452
<br />
@@ -1113,5 +1117,3 @@ class NotebookInstructions extends PromptElement<DefaultAgentPromptProps> {
11131117
</Tag>;
11141118
}
11151119
}
1116-
1117-

0 commit comments

Comments
 (0)