diegosouzapw/OmniRoute · error · Error

Kimi Web only supports text message content

Error message

Kimi Web only supports text message content

What it means

Capability validation in textFromContent (Kimi Web): message content is neither a string nor an array (or an array element is not an object). Kimi's web endpoint accepts only a folded text prompt, so any other content shape is rejected before dispatch.

Solutions

  1. Return a 400: Kimi Web supports only text message content
  2. Coerce scalar content to string before folding if lenient handling is wanted
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at open-sse/executors/kimi-web.ts:212 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/3c39653acc42f273. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/executors/kimi-web.ts:212

  }
  return null;
}

type KimiWebInputMessage = {
  role: string;
  content: unknown;
  tool_calls?: unknown;
};

export interface FoldedKimiWebMessages {
  prompt: string;
  systemPrompt: string;
}

function textFromContent(content: unknown): string {
  if (typeof content === "string") return content;
  if (!Array.isArray(content)) {
    throw new Error("Kimi Web only supports text message content");
  }

  return content
    .map((part) => {
      if (!part || typeof part !== "object" || Array.isArray(part)) {
        throw new Error("Kimi Web only supports text message content");
      }
      const record = part as Record<string, unknown>;
      if (
        (record.type === "text" || record.type === "input_text") &&
        typeof record.text === "string"
      ) {
        return record.text;
      }
      throw new Error("Kimi Web does not support image, audio, file, or tool content");
    })
    .join("");
}

View on GitHub (pinned to a179ffed5b)