Skip to content

Commit 4f55493

Browse files
committed
fix: allow text content after update_todo_list tool (#5847)
The update_todo_list tool is a special case that doesn't produce actionable output or require user interaction beyond confirmation. Unlike other tools that perform file operations or system commands, update_todo_list simply updates the UI's todo list display. This change exempts update_todo_list from setting the didAlreadyUseTool flag, which allows subsequent text content to be rendered. This enables the assistant to provide context or explanations after updating the todo list, improving the user experience. The one-tool-per-message restriction remains in effect for all other tools to prevent multiple potentially conflicting operations in a single message.
1 parent 9fce90b commit 4f55493

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/assistant-message/presentAssistantMessage.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,11 @@ export async function presentAssistantMessage(cline: Task) {
256256

257257
// Once a tool result has been collected, ignore all other tool
258258
// uses since we should only ever present one tool result per
259-
// message.
260-
cline.didAlreadyUseTool = true
259+
// message. Exception: update_todo_list is allowed to be followed
260+
// by text content.
261+
if (block.name !== "update_todo_list") {
262+
cline.didAlreadyUseTool = true
263+
}
261264
}
262265

263266
const askApproval = async (

0 commit comments

Comments
 (0)