diegosouzapw/OmniRoute · error

NanoBanana task completed without image payload

Error message

NanoBanana task completed without image payload: ${JSON.stringify(taskData).slice(0, 240)}

What it means

The NanoBanana (Gemini image) task reached a completed state but its payload contained no image data — no URL candidates and no base64 candidates were extracted. The handler logs a truncated task-data dump and fails the generation request rather than returning an empty result, typically indicating an upstream generation failure reported without an error status.

Solutions

  1. Inspect the logged task payload for the actual completion payload shape
  2. Retry the generation — transient empty completions occur
  3. Check NanoBanana task status fields for a hidden error/reason
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at open-sse/handlers/imageGeneration.ts:3291 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/b0b5f130f88484a3. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/handlers/imageGeneration.ts:3291

    if (urlCandidates.length > 0) {
      const firstUrl = urlCandidates[0];
      const remoteImage = await fetchRemoteImage(firstUrl);
      const base64 = remoteImage.buffer.toString("base64");
      return [{ b64_json: base64, revised_prompt: body.prompt }];
    }
  }

  if (urlCandidates.length > 0) {
    return urlCandidates.map((url) => ({ url, revised_prompt: body.prompt }));
  }

  if (b64Candidates.length > 0) {
    return b64Candidates.map((b64) => ({ b64_json: b64, revised_prompt: body.prompt }));
  }

  if (log) {
    log.warn(
      "IMAGE",
      `NanoBanana task completed without image payload: ${JSON.stringify(taskData).slice(0, 240)}`
    );
  }

  return [];
}

function inferResolutionFromSize(size) {
  if (typeof size !== "string") return null;
  const [wRaw, hRaw] = size.split("x");
  const width = Number(wRaw);
  const height = Number(hRaw);
  if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) return null;

  const longestSide = Math.max(width, height);
  if (longestSide <= 1024) return "1K";
  if (longestSide <= 2048) return "2K";

View on GitHub (pinned to a179ffed5b)