Skip to content

7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

TypeScript

fix(shared): widen ChatContentBlock for type-less and string blocks (#200)

Tashfeen5bd3afc93582
diff --git a/shared/types.ts b/shared/types.ts
index 458a4b22..8abdcf20 100644
--- a/shared/types.ts
+++ b/shared/types.ts
@@ -124,10 +124,12 @@ export type ChatToolChoice =
};
// OpenAI's multimodal envelope: clients like opencode / continue.dev send
-// content as an array of typed blocks even for text-only messages. We accept
-// it on the wire and flatten to string for providers that don't support it
-// (Cohere, Cloudflare). See server/src/lib/content.ts.
-export type ChatContentBlock = { type: string; text?: string; [key: string]: unknown };
+// content as an array of typed blocks even for text-only messages, and
+// Gemini-lineage agents (Qwen Code, AionUI) send part-style `{ text }` blocks
+// with no `type` — plus bare strings inside arrays. We accept all of it on
+// the wire and flatten to string for providers that don't support arrays
+// (Cohere, Cloudflare). See server/src/lib/content.ts. (#200)
+export type ChatContentBlock = string | { type?: string; text?: string; [key: string]: unknown };
export type ChatContent = string | null | ChatContentBlock[];
export interface ChatMessage {