This commit is contained in:
roomote-v0[bot] 2026-05-13 01:41:35 -04:00 • committed by GitHub
commit ca9878f426
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2730,6 +2730,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
let assistantMessage = "" let assistantMessage = ""
let reasoningMessage = "" let reasoningMessage = ""
let pendingGroundingSources: GroundingSource[] = [] let pendingGroundingSources: GroundingSource[] = []
let streamChunkCount = 0
this.isStreaming = true this.isStreaming = true
try { try {
@ -2768,6 +2769,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
continue continue
} }
streamChunkCount++
switch (chunk.type) { switch (chunk.type) {
case "reasoning": { case "reasoning": {
reasoningMessage += chunk.text reasoningMessage += chunk.text
@ -3521,6 +3523,9 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
// or tool_use content blocks from API which we should assume is // or tool_use content blocks from API which we should assume is
// an error. // an error.
console.log(
`[Task#${this.taskId}.${this.instanceId}] Empty API response: streamChunks=${streamChunkCount}, hasReasoning=${reasoningMessage.length > 0}, contentBlocks=${this.assistantMessageContent.length}`,
)
// Increment consecutive no-assistant-messages counter // Increment consecutive no-assistant-messages counter
this.consecutiveNoAssistantMessagesCount++ this.consecutiveNoAssistantMessagesCount++
@ -3584,10 +3589,12 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
await this.say("api_req_retried") await this.say("api_req_retried")
// Push the same content back to retry // Push the same content back to retry
// Mark that user message was removed so it gets re-added on retry
stack.push({ stack.push({
userContent: currentUserContent, userContent: currentUserContent,
includeFileDetails: false, includeFileDetails: false,
retryAttempt: (currentItem.retryAttempt ?? 0) + 1, retryAttempt: (currentItem.retryAttempt ?? 0) + 1,
userMessageWasRemoved: true,
}) })
// Continue to retry the request // Continue to retry the request