{"record":{"id":"e77d78c7ea4034bd","repo":"diegosouzapw/OmniRoute","slug":"promptql-stream-timeout-after-timeoutms-ms-thre","errorCode":null,"errorMessage":"PromptQL stream timeout after ${timeoutMs}ms (thread ${opts.threadId}, events=${collected.length})","messagePattern":"PromptQL stream timeout after (.+?)ms \\(thread (.+?), events=(.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/promptql.ts","lineNumber":442,"sourceCode":"      if (msg) best = msg;\n      if (isFinalAgentEvent(ev.event_data) && msg) {\n        sawFinal = true;\n      }\n      // Strict stop: final_response_sent\n      if (JSON.stringify(ev.event_data || {}).includes(\"final_response_sent\") && best) {\n        return { text: best, lastEventId: cursor, events: collected };\n      }\n    }\n    if (sawFinal && best) {\n      // one extra idle poll to catch trailing metadata\n      await new Promise((r) => setTimeout(r, intervalMs));\n      return { text: best, lastEventId: cursor, events: collected };\n    }\n    await new Promise((r) => setTimeout(r, intervalMs));\n  }\n\n  if (best) return { text: best, lastEventId: cursor, events: collected };\n  throw new Error(\n    `PromptQL stream timeout after ${timeoutMs}ms (thread ${opts.threadId}, events=${collected.length})`\n  );\n}\n\n// ─── Executor ───────────────────────────────────────────────────────────────\n\nexport class PromptQlExecutor extends BaseExecutor {\n  constructor() {\n    super(\"promptql\", {\n      id: \"promptql\",\n      baseUrl: PLAYGROUND_GQL,\n    });\n  }\n\n  async execute(input: ExecuteInput) {\n    const { model, body, stream: wantStream, credentials, signal } = input;\n    const requestBody = (body || {}) as PromptQlRequestBody;\n    let { token, projectId, cookie, timezone } = resolvePromptQlCredentials(credentials);","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/promptql.ts#L424-L460","documentation":"pollAssistantText hit its timeout budget while polling the PromptQL thread for a final assistant message: no final agent event was observed within timeoutMs. The message reports the thread id and how many events were collected so far, indicating the agent run stalled, was still processing, or the stop condition (final_response_sent) never appeared.","triggerScenarios":"Thrown at open-sse/executors/promptql.ts:442 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase timeoutMs for long-running agent turns","Resume polling from the stored lastEventId cursor instead of restarting","Alert on repeated timeouts for the same thread id"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}