From 68a467dd66e338be2a7ce158c6b305de54dfb40c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 20 Jan 2026 14:39:58 +0000 Subject: [PATCH] fix: guard ZAI compat on openai-completions api --- src/agents/model-compat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/model-compat.ts b/src/agents/model-compat.ts index 11f422c74..70bc56aad 100644 --- a/src/agents/model-compat.ts +++ b/src/agents/model-compat.ts @@ -3,7 +3,7 @@ import type { Api, Model } from "@mariozechner/pi-ai"; export function normalizeModelCompat(model: Model): Model { const baseUrl = model.baseUrl ?? ""; const isZai = model.provider === "zai" || baseUrl.includes("api.z.ai"); - if (!isZai || !isOpenAICompletionsModel(model)) return model; + if (!isZai || model.api !== "openai-completions") return model; const compat = model.compat ?? {}; if (compat.supportsDeveloperRole === false) return model;