fix: prevent infinite loop when attempt_completion succeeds (#9325)

This commit is contained in:
Daniel 2025-11-17 18:24:48 -05:00 committed by GitHub
parent 3091506942
commit e742511d90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,10 +83,10 @@ export class AttemptCompletionTool extends BaseTool<"attempt_completion"> {
const { response, text, images } = await task.ask("completion_result", "", false)
if (response === "yesButtonClicked") {
pushToolResult("")
return
}
// User provided feedback - push tool result to continue the conversation
await task.say("user_feedback", text ?? "", images)
const feedbackText = `The user has provided feedback on the results. Consider their input to continue the task, and then attempt completion again.\n<feedback>\n${text}\n</feedback>`