diff --git a/src/core/task/tools/handlers/AttemptCompletionHandler.ts b/src/core/task/tools/handlers/AttemptCompletionHandler.ts index f4fc8e47..57d13b24 100644 --- a/src/core/task/tools/handlers/AttemptCompletionHandler.ts +++ b/src/core/task/tools/handlers/AttemptCompletionHandler.ts @@ -93,7 +93,7 @@ export class AttemptCompletionHandler implements IToolHandler, IPartialBlockHand } // Remove any partial completion_result message that may exist - // PreToolUse hook inserts messages after the partial, so we need to search backwards to find it + // Search backwards since other messages may have been inserted after the partial const clineMessages = config.messageState.getClineMessages() const partialCompletionIndex = findLastIndex( clineMessages, diff --git a/src/core/task/tools/utils/ToolHookUtils.ts b/src/core/task/tools/utils/ToolHookUtils.ts index c8fd6e40..aab97fc9 100644 --- a/src/core/task/tools/utils/ToolHookUtils.ts +++ b/src/core/task/tools/utils/ToolHookUtils.ts @@ -25,6 +25,10 @@ export class ToolHookUtils { return true // Hooks disabled, continue execution } + if (block.name == "attempt_completion") { + return true // Skip this hook + } + // Import the hook executor dynamically const { executeHook } = await import("@core/hooks/hook-executor")