fix: attempt_completion showing twice in chat due to partial logic not being handled correctly (#5588)

* fix: attempt_completion showing twice in chat due to partial logic not being handled correctly

* Create orange-beds-itch.md
This commit is contained in:
Saoud Rizwan authored and GitHub committed 2025-08-14 22:35:19 -07:00
1 parent 5d65260611
commit 9a2aaf0881
2 files changed
+17 -11

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Fix attempt_completion showing twice in chat due to partial logic not being handled correctly
+12 -11
View File
@@ -2235,17 +2235,18 @@ export class ToolExecutor {
// () => {},
// )
} else {
// last message is completion_result
// we have command string, which means we have the result as well, so finish it (doesn't have to exist yet)
await this.say(
"completion_result",
this.removeClosingTag(block, "result", result),
undefined,
undefined,
false,
)
await this.saveCheckpoint(true)
await addNewChangesFlagToLastCompletionResultMessage()
// Now that we don't stream a command, we shouldn't be completing the attempt_completion tool in the block.partial conditional, and instead do it when partial is false below
//
// last message is completion_result, we have command string, which means we have the result as well, so finish it (doesn't have to exist yet)
// await this.say(
// "completion_result",
// this.removeClosingTag(block, "result", result),
// undefined,
// undefined,
// false,
// )
// await this.saveCheckpoint(true)
// await addNewChangesFlagToLastCompletionResultMessage()
// await this.ask("command", this.removeClosingTag(block, "command", command), block.partial).catch(
// () => {},
// )