{"record":{"id":"0d38f1955c14db16","repo":"ComposioHQ/composio","slug":"no-run-id-found","errorCode":null,"errorMessage":"No run ID found","messagePattern":"No run ID found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/provider/OpenAIProvider.ts","lineNumber":480,"sourceCode":"          tool_outputs: toolOutputs,\n        });\n      }\n\n      // Break if the run status becomes inactive\n      if (\n        [\n          'thread.run.completed',\n          'thread.run.failed',\n          'thread.run.cancelled',\n          'thread.run.expired',\n        ].includes(event.event)\n      ) {\n        break;\n      }\n    }\n\n    if (!runId) {\n      throw new Error('No run ID found');\n    }\n\n    // Handle any final actions after the stream ends\n    let finalRun = await client.beta.threads.runs.retrieve(runId, {\n      thread_id: thread.id,\n    });\n\n    while (['queued', 'in_progress', 'requires_action'].includes(finalRun.status)) {\n      if (finalRun.status === 'requires_action') {\n        const toolOutputs = await this.handleAssistantMessage(userId, finalRun, options, modifiers);\n\n        // Submit tool outputs\n        finalRun = await client.beta.threads.runs.submitToolOutputs(runId, {\n          thread_id: thread.id,\n          tool_outputs: toolOutputs,\n        });\n      } else {\n        // Update the run status","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/provider/OpenAIProvider.ts#L462-L498","documentation":"OpenAIProvider.waitAndHandleAssistantStreamToolCalls throws 'No run ID found' when it finishes consuming a streamed assistant (OpenAI Assistants API) response without ever observing a run ID. Without a run ID the SDK cannot retrieve the final run to inspect required actions/tool calls, so the streaming tool-call handling aborts.","triggerScenarios":"Streaming an OpenAI Assistant response (client.beta.threads.runs.stream) where the stream completes but no event carrying thread.run.id (or equivalent run identifier) arrives — e.g. malformed/partial stream, unexpected event ordering, or an API response shape change from a version bump of the openai package.","commonSituations":"Upgrading the openai SDK or Composio SDK where stream event names changed; proxy or gateway stripping SSE events; network interruption truncating the stream before the run event; using a thread/run created outside the SDK.","solutions":["Check that you pass the correct threadId and that the run was created and streamed via client.beta.threads.runs.stream","Pin/upgrade the openai package to a version compatible with your @composio/core version so run-identification events are parsed","Log the raw stream events to confirm a thread.run event with an id is present; if absent, inspect network/proxy interference","Retry the request — transient truncation can cause a missing run event"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (!threadId || !runId) throw new Error('Missing thread/run before streaming assistant tool calls');","typeGuard":null,"tryCatchPattern":"try { await waitAndHandleAssistantStreamToolCalls(...); } catch (e) { if (e instanceof Error && e.message === 'No run ID found') { await retryWithBackoff(...); } else throw e; }","preventionTips":["Pin compatible openai + @composio/core versions","Verify thread and run exist before streaming","Retry once on truncated streams"],"tags":["openai","assistant","streaming","tool-calls"],"backgroundTag":"stream-missing-run-id","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}