Skip to content

Commit d969f20

Browse files
committed
refactor: centralize attempt_completion failure guard in tool
1 parent 53aceb0 commit d969f20

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/core/assistant-message/presentAssistantMessage.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -715,17 +715,6 @@ export async function presentAssistantMessage(cline: Task) {
715715
})
716716
break
717717
case "attempt_completion": {
718-
// Prevent attempt_completion if any tool failed in the current assistant message (turn).
719-
// This only applies to tools called within the same message, not across different turns.
720-
// For example, this blocks: read_file (fails) + attempt_completion in same message
721-
// But allows: read_file (fails) → user message → attempt_completion in next turn
722-
if (cline.didToolFailInCurrentTurn) {
723-
const errorMsg = `Cannot execute attempt_completion because a previous tool call failed in this turn. Please address the tool failure before attempting completion.`
724-
await cline.say("error", errorMsg)
725-
pushToolResult(formatResponse.toolError(errorMsg))
726-
break
727-
}
728-
729718
const completionCallbacks: AttemptCompletionCallbacks = {
730719
askApproval,
731720
handleError,

0 commit comments

Comments
 (0)