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.
This commit is contained in:
Daniel Riccio 2025-07-21 08:26:50 -05:00
parent 9fce90be9d
commit 4f5549391e
No known key found for this signature in database
GPG key ID: FFD5FD825F8E8209

View file

@ -256,8 +256,11 @@ export async function presentAssistantMessage(cline: Task) {
// Once a tool result has been collected, ignore all other tool
// uses since we should only ever present one tool result per
// message.
cline.didAlreadyUseTool = true
// message. Exception: update_todo_list is allowed to be followed
// by text content.
if (block.name !== "update_todo_list") {
cline.didAlreadyUseTool = true
}
}
const askApproval = async (