From 63a25e8f24aa32119995b907291eedbf60a8cb1b Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 17 Feb 2026 05:46:40 +0000 Subject: [PATCH] refactor: move usage examples back to description for write_todos --- .../coreToolsModelSnapshots.test.ts.snap | 72 +++++++++---------- .../core/src/tools/definitions/coreTools.ts | 36 +++++----- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap index 624c93db32..5d26aa3e0f 100644 --- a/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap +++ b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap @@ -691,24 +691,7 @@ Each of the subtasks should be clear and distinct. Use this tool for complex queries that require multiple steps. If you find that the request is actually complex after you have started executing the user task, create a todo list and use it. If execution of the user task requires multiple steps, planning and generally is higher complexity than a simple Q&A, use this tool. -DO NOT use this tool for simple tasks that can be completed in less than 2 steps. If the user query is simple and straightforward, do not use the tool. If you can respond with an answer in a single turn then this tool is not required.", - "instructions": " -## Task state definitions - -- pending: Work has not begun on a given subtask. -- in_progress: Marked just prior to beginning work on a given subtask. You should only have one subtask as in_progress at a time. -- completed: Subtask was successfully completed with no errors or issues. If the subtask required more steps to complete, update the todo list with the subtasks. All steps should be identified as completed only when they are completed. -- cancelled: As you update the todo list, some tasks are not required anymore due to the dynamic nature of the task. In this case, mark the subtasks as cancelled. - - -## Methodology for using this tool -1. Use this todo list as soon as you receive a user request based on the complexity of the task. -2. Keep track of every subtask that you update the list with. -3. Mark a subtask as in_progress before you begin working on it. You should only have one subtask as in_progress at a time. -4. Update the subtask list as you proceed in executing the task. The subtask list is not static and should reflect your progress and current plans, which may evolve as you acquire new information. -5. Mark a subtask as completed when you have completed it. -6. Mark a subtask as cancelled if the subtask is no longer needed. -7. You must update the todo list as soon as you start, stop or cancel a subtask. Don't batch or wait to update the todo list. +DO NOT use this tool for simple tasks that can be completed in less than 2 steps. If the user query is simple and straightforward, do not use the tool. If you can respond with an answer in a single turn then this tool is not required. ## Examples of When to Use the Todo List @@ -747,6 +730,23 @@ Agent: The agent did not use the todo list because this task could be completed by a tight loop of execute test->edit->execute test. ", + "instructions": " +## Task state definitions + +- pending: Work has not begun on a given subtask. +- in_progress: Marked just prior to beginning work on a given subtask. You should only have one subtask as in_progress at a time. +- completed: Subtask was successfully completed with no errors or issues. If the subtask required more steps to complete, update the todo list with the subtasks. All steps should be identified as completed only when they are completed. +- cancelled: As you update the todo list, some tasks are not required anymore due to the dynamic nature of the task. In this case, mark the subtasks as cancelled. + + +## Methodology for using this tool +1. Use this todo list as soon as you receive a user request based on the complexity of the task. +2. Keep track of every subtask that you update the list with. +3. Mark a subtask as in_progress before you begin working on it. You should only have one subtask as in_progress at a time. +4. Update the subtask list as you proceed in executing the task. The subtask list is not static and should reflect your progress and current plans, which may evolve as you acquire new information. +5. Mark a subtask as completed when you have completed it. +6. Mark a subtask as cancelled if the subtask is no longer needed. +7. You must update the todo list as soon as you start, stop or cancel a subtask. Don't batch or wait to update the todo list.", "name": "write_todos", "parametersJsonSchema": { "additionalProperties": false, @@ -1480,24 +1480,7 @@ Each of the subtasks should be clear and distinct. Use this tool for complex queries that require multiple steps. If you find that the request is actually complex after you have started executing the user task, create a todo list and use it. If execution of the user task requires multiple steps, planning and generally is higher complexity than a simple Q&A, use this tool. -DO NOT use this tool for simple tasks that can be completed in less than 2 steps. If the user query is simple and straightforward, do not use the tool. If you can respond with an answer in a single turn then this tool is not required.", - "instructions": " -## Task state definitions - -- pending: Work has not begun on a given subtask. -- in_progress: Marked just prior to beginning work on a given subtask. You should only have one subtask as in_progress at a time. -- completed: Subtask was successfully completed with no errors or issues. If the subtask required more steps to complete, update the todo list with the subtasks. All steps should be identified as completed only when they are completed. -- cancelled: As you update the todo list, some tasks are not required anymore due to the dynamic nature of the task. In this case, mark the subtasks as cancelled. - - -## Methodology for using this tool -1. Use this todo list as soon as you receive a user request based on the complexity of the task. -2. Keep track of every subtask that you update the list with. -3. Mark a subtask as in_progress before you begin working on it. You should only have one subtask as in_progress at a time. -4. Update the subtask list as you proceed in executing the task. The subtask list is not static and should reflect your progress and current plans, which may evolve as you acquire new information. -5. Mark a subtask as completed when you have completed it. -6. Mark a subtask as cancelled if the subtask is no longer needed. -7. You must update the todo list as soon as you start, stop or cancel a subtask. Don't batch or wait to update the todo list. +DO NOT use this tool for simple tasks that can be completed in less than 2 steps. If the user query is simple and straightforward, do not use the tool. If you can respond with an answer in a single turn then this tool is not required. ## Examples of When to Use the Todo List @@ -1536,6 +1519,23 @@ Agent: The agent did not use the todo list because this task could be completed by a tight loop of execute test->edit->execute test. ", + "instructions": " +## Task state definitions + +- pending: Work has not begun on a given subtask. +- in_progress: Marked just prior to beginning work on a given subtask. You should only have one subtask as in_progress at a time. +- completed: Subtask was successfully completed with no errors or issues. If the subtask required more steps to complete, update the todo list with the subtasks. All steps should be identified as completed only when they are completed. +- cancelled: As you update the todo list, some tasks are not required anymore due to the dynamic nature of the task. In this case, mark the subtasks as cancelled. + + +## Methodology for using this tool +1. Use this todo list as soon as you receive a user request based on the complexity of the task. +2. Keep track of every subtask that you update the list with. +3. Mark a subtask as in_progress before you begin working on it. You should only have one subtask as in_progress at a time. +4. Update the subtask list as you proceed in executing the task. The subtask list is not static and should reflect your progress and current plans, which may evolve as you acquire new information. +5. Mark a subtask as completed when you have completed it. +6. Mark a subtask as cancelled if the subtask is no longer needed. +7. You must update the todo list as soon as you start, stop or cancel a subtask. Don't batch or wait to update the todo list.", "name": "write_todos", "parametersJsonSchema": { "additionalProperties": false, diff --git a/packages/core/src/tools/definitions/coreTools.ts b/packages/core/src/tools/definitions/coreTools.ts index ebda89cbe1..17d795c683 100644 --- a/packages/core/src/tools/definitions/coreTools.ts +++ b/packages/core/src/tools/definitions/coreTools.ts @@ -653,24 +653,7 @@ Each of the subtasks should be clear and distinct. Use this tool for complex queries that require multiple steps. If you find that the request is actually complex after you have started executing the user task, create a todo list and use it. If execution of the user task requires multiple steps, planning and generally is higher complexity than a simple Q&A, use this tool. -DO NOT use this tool for simple tasks that can be completed in less than 2 steps. If the user query is simple and straightforward, do not use the tool. If you can respond with an answer in a single turn then this tool is not required.`, - instructions: ` -## Task state definitions - -- pending: Work has not begun on a given subtask. -- in_progress: Marked just prior to beginning work on a given subtask. You should only have one subtask as in_progress at a time. -- completed: Subtask was successfully completed with no errors or issues. If the subtask required more steps to complete, update the todo list with the subtasks. All steps should be identified as completed only when they are completed. -- cancelled: As you update the todo list, some tasks are not required anymore due to the dynamic nature of the task. In this case, mark the subtasks as cancelled. - - -## Methodology for using this tool -1. Use this todo list as soon as you receive a user request based on the complexity of the task. -2. Keep track of every subtask that you update the list with. -3. Mark a subtask as in_progress before you begin working on it. You should only have one subtask as in_progress at a time. -4. Update the subtask list as you proceed in executing the task. The subtask list is not static and should reflect your progress and current plans, which may evolve as you acquire new information. -5. Mark a subtask as completed when you have completed it. -6. Mark a subtask as cancelled if the subtask is no longer needed. -7. You must update the todo list as soon as you start, stop or cancel a subtask. Don't batch or wait to update the todo list. +DO NOT use this tool for simple tasks that can be completed in less than 2 steps. If the user query is simple and straightforward, do not use the tool. If you can respond with an answer in a single turn then this tool is not required. ## Examples of When to Use the Todo List @@ -709,6 +692,23 @@ Agent: The agent did not use the todo list because this task could be completed by a tight loop of execute test->edit->execute test. `, + instructions: ` +## Task state definitions + +- pending: Work has not begun on a given subtask. +- in_progress: Marked just prior to beginning work on a given subtask. You should only have one subtask as in_progress at a time. +- completed: Subtask was successfully completed with no errors or issues. If the subtask required more steps to complete, update the todo list with the subtasks. All steps should be identified as completed only when they are completed. +- cancelled: As you update the todo list, some tasks are not required anymore due to the dynamic nature of the task. In this case, mark the subtasks as cancelled. + + +## Methodology for using this tool +1. Use this todo list as soon as you receive a user request based on the complexity of the task. +2. Keep track of every subtask that you update the list with. +3. Mark a subtask as in_progress before you begin working on it. You should only have one subtask as in_progress at a time. +4. Update the subtask list as you proceed in executing the task. The subtask list is not static and should reflect your progress and current plans, which may evolve as you acquire new information. +5. Mark a subtask as completed when you have completed it. +6. Mark a subtask as cancelled if the subtask is no longer needed. +7. You must update the todo list as soon as you start, stop or cancel a subtask. Don't batch or wait to update the todo list.`, parametersJsonSchema: { type: 'object', properties: {