diegosouzapw/OmniRoute · error · Error

PromptQL stream timeout after

Error message

PromptQL stream timeout after ${timeoutMs}ms (thread ${opts.threadId}, events=${collected.length})

What it means

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.

Solutions

  1. Increase timeoutMs for long-running agent turns
  2. Resume polling from the stored lastEventId cursor instead of restarting
  3. Alert on repeated timeouts for the same thread id
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at open-sse/executors/promptql.ts:442 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/e77d78c7ea4034bd. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/executors/promptql.ts:442

      if (msg) best = msg;
      if (isFinalAgentEvent(ev.event_data) && msg) {
        sawFinal = true;
      }
      // Strict stop: final_response_sent
      if (JSON.stringify(ev.event_data || {}).includes("final_response_sent") && best) {
        return { text: best, lastEventId: cursor, events: collected };
      }
    }
    if (sawFinal && best) {
      // one extra idle poll to catch trailing metadata
      await new Promise((r) => setTimeout(r, intervalMs));
      return { text: best, lastEventId: cursor, events: collected };
    }
    await new Promise((r) => setTimeout(r, intervalMs));
  }

  if (best) return { text: best, lastEventId: cursor, events: collected };
  throw new Error(
    `PromptQL stream timeout after ${timeoutMs}ms (thread ${opts.threadId}, events=${collected.length})`
  );
}

// ─── Executor ───────────────────────────────────────────────────────────────

export class PromptQlExecutor extends BaseExecutor {
  constructor() {
    super("promptql", {
      id: "promptql",
      baseUrl: PLAYGROUND_GQL,
    });
  }

  async execute(input: ExecuteInput) {
    const { model, body, stream: wantStream, credentials, signal } = input;
    const requestBody = (body || {}) as PromptQlRequestBody;
    let { token, projectId, cookie, timezone } = resolvePromptQlCredentials(credentials);

View on GitHub (pinned to a179ffed5b)