{"record":{"id":"8540e97118b45f39","repo":"FlowiseAI/Flowise","slug":"error-processing-thread-state-thread-id-th","errorCode":null,"errorMessage":"Error processing thread: ${state}, Thread ID: ${threadId}","messagePattern":"Error processing thread: (.+?), Thread ID: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts","lineNumber":801,"sourceCode":"            while (state === 'requires_action') {\n                state = await promise(threadId, runThread.id)\n            }\n\n            let retries = 3\n            while (state === 'requires_action_retry') {\n                if (retries > 0) {\n                    retries -= 1\n                    const newRunThread = await openai.beta.threads.runs.create(threadId, {\n                        assistant_id: retrievedAssistant.id,\n                        tool_choice: toolChoice,\n                        parallel_tool_calls: parallelToolCalls\n                    })\n                    runThreadId = newRunThread.id\n                    state = await promise(threadId, newRunThread.id)\n                } else {\n                    const errMsg = `Error processing thread: ${state}, Thread ID: ${threadId}`\n                    await analyticHandlers.onChainError(parentIds, errMsg, true)\n                    throw new Error(errMsg)\n                }\n            }\n\n            // List messages\n            const messages = await openai.beta.threads.messages.list(threadId)\n            const messageData = messages.data ?? []\n            const assistantMessages = messageData.filter((msg) => msg.role === 'assistant')\n            if (!assistantMessages.length) return ''\n\n            let returnVal = ''\n            for (let i = 0; i < assistantMessages[0].content.length; i += 1) {\n                if (assistantMessages[0].content[i].type === 'text') {\n                    const content = assistantMessages[0].content[i] as OpenAI.Beta.Threads.Messages.TextContentBlock\n\n                    if (content.text.annotations) {\n                        const message_content = content.text\n                        const annotations = message_content.annotations\n","sourceCodeStart":783,"sourceCodeEnd":819,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts#L783-L819","documentation":"The assistant polls the run status; when the state is `requires_action_retry` the code re-creates the run up to 3 times. If after 3 retries the state is still `requires_action_retry` (tools keep failing to produce actionable output), it throws 'Error processing thread: requires_action_retry'. The literal state string is interpolated so other terminal states would surface too.","triggerScenarios":"Tool execution/submission repeatedly fails in a way the loop treats as retryable — tools error on every retry, the model keeps requesting tools that cannot complete, or submission keeps timing out.","commonSituations":"A tool is broken (so the assistant cannot progress); model stuck in a tool-call loop; submission timeouts due to slow tools; flaky upstream causing repeated partial failure.","solutions":["Inspect the prior tool errors (errors 32/33 fire on each retry) in the logs to find the persistent tool failure.","Fix or disable the failing tool, then re-run.","If the model loops on tools, tighten tool descriptions or raise the retry budget after fixing the tool.","Confirm tools complete well within the run's lifetime.","Consider simplifying the assistant's tool set to isolate the culprit."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await assistantNode.run(nodeData, input, options)\n} catch (e) {\n  if ((e as Error).message.startsWith('Error processing thread:')) {\n    // inspect the inner tool errors (32/33) that forced the retry exhaustion\n  }\n  throw e\n}","preventionTips":["Resolve persistent tool failures before relying on the assistant.","Limit the assistant's tool set to known-working tools during debugging.","Improve tool descriptions to prevent model tool-call loops.","Monitor run status analytics to spot retry storms early."],"tags":["agent","openai-assistant","run-status","retry-exhausted","tool-loop"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}