diegosouzapw/OmniRoute · error

Vision API error: ${message}

Error message

Vision API error: ${message}

What it means

Error "Vision API error: ${message}" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/guardrails/visionBridgeHelpers.ts:516

    if (!chunk || typeof chunk !== "object") continue;

    const unwrapped = unwrapVisionSummary(chunk) as Record<string, unknown>;

    // Error-only SSE chunk (`data: {"error":{...}}` with no choices) — surface
    // the upstream message instead of a generic "empty or invalid response".
    if (unwrapped.error != null && !Array.isArray(unwrapped.choices)) {
      const err = unwrapped.error;
      let message = "";
      if (typeof err === "string") {
        message = err;
      } else if (typeof err === "object" && !Array.isArray(err)) {
        message = (err as { message?: unknown }).message
          ? String((err as { message?: unknown }).message)
          : JSON.stringify(err);
      } else {
        message = String(err);
      }
      throw new Error(`Vision API error: ${message}`);
    }

    const choice = (unwrapped.choices as Array<Record<string, unknown>> | undefined)?.[0];
    if (choice) sawChoices = true;

    const delta = choice?.delta as Record<string, unknown> | undefined;
    if (typeof delta?.content === "string" && delta.content.length > 0) {
      contentParts.push(delta.content);
    }
    if (typeof delta?.reasoning_content === "string" && delta.reasoning_content.length > 0) {
      reasoningParts.push(delta.reasoning_content);
    }
    // opencode-routed gateways (e.g. mimo-v2.5-free) stream chain-of-thought in
    // `delta.reasoning` instead of `reasoning_content` (#6623).
    if (typeof delta?.reasoning === "string" && delta.reasoning.length > 0) {
      reasoningParts.push(delta.reasoning);
    }

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/guardrails/visionBridgeHelpers.ts:516 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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