diff --git a/src/agent/modify.ts b/src/agent/modify.ts index b22e64d..75bef83 100644 --- a/src/agent/modify.ts +++ b/src/agent/modify.ts @@ -30,6 +30,7 @@ function buildModelSettings( const isAnthropic = modelHandle.startsWith("anthropic/") || modelHandle.startsWith(`${ANTHROPIC_PROVIDER_NAME}/`); + const isZai = modelHandle.startsWith("zai/"); const isGoogleAI = modelHandle.startsWith("google_ai/"); const isGoogleVertex = modelHandle.startsWith("google_vertex/"); const isOpenRouter = modelHandle.startsWith("openrouter/"); @@ -70,6 +71,13 @@ function buildModelSettings( }; } settings = anthropicSettings; + } else if (isZai) { + // Zai uses the same model_settings structure as other providers. + // Ensure parallel_tool_calls is enabled. + settings = { + provider_type: "zai", + parallel_tool_calls: true, + }; } else if (isGoogleAI) { const googleSettings: GoogleAIModelSettings & { temperature?: number } = { provider_type: "google_ai",