From 0760818025c3b78502c2e010c0992eabf4de2aff Mon Sep 17 00:00:00 2001 From: neorrk <58256328+neorrk@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:02:06 +0100 Subject: [PATCH] fix: add hasReasoningContent to second content gate in Task.ts The first content gate (line 3416) was updated to include hasReasoningContent, but the second gate (line 3567) was not. This caused reasoning-only responses to save an assistant message to history but then fall through to the "no assistant messages" error path, incrementing the retry counter and leaving an orphaned assistant message in conversation history. Both gates now consistently check: if (hasTextContent || hasToolUses || hasReasoningContent) Addresses review feedback from @roomote. Co-Authored-By: Claude Opus 4.6 --- src/core/task/Task.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index b24d3ffe1b..4d4bb49d55 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -3564,7 +3564,7 @@ export class Task extends EventEmitter implements TaskLike { presentAssistantMessage(this) } - if (hasTextContent || hasToolUses) { + if (hasTextContent || hasToolUses || hasReasoningContent) { // NOTE: This comment is here for future reference - this was a // workaround for `userMessageContent` not getting set to true. // It was due to it not recursively calling for partial blocks