openclaw - 💡(How to fix) Fix [Bug]: zai provider: thinking/reasoning parameter never sent to API — affects all endpoints [1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71556Fetched 2026-04-26 05:11:31
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

The zai provider plugin declares thinkingFormat: "zai" but no code path consumes it. The thinking/reasoning parameter is never sent to the 智谱 API, regardless of which endpoint is used. Two separate code paths both block supportsReasoningEffort: false.

Root Cause

The blocking happens in provider-model-compat-D5P6lFk0.js line 36:

supportsReasoningEffort: !isZai && knownProviderFamily !== "mistral" && endpointClass !== "xai-native" && !usesExplicitProxyLikeEndpoint,

Code Example

supportsReasoningEffort: !isZai && knownProviderFamily !== "mistral" && endpointClass !== "xai-native" && !usesExplicitProxyLikeEndpoint,

---

// Path A: OpenRouter
if (compat.thinkingFormat === "openrouter") {
  params.reasoning = { effort: ... };
}

// Path B: Standard OpenAI reasoning_effort
if (compat.supportsReasoningEffort && model.reasoning) {
  params.reasoning_effort = ...;
}
RAW_BUFFERClick to expand / collapse

zai provider: thinking/reasoning parameter never sent to API — affects all endpoints

Summary

The zai provider plugin declares thinkingFormat: "zai" but no code path consumes it. The thinking/reasoning parameter is never sent to the 智谱 API, regardless of which endpoint is used. Two separate code paths both block supportsReasoningEffort: false.

Affected Versions

OpenClaw 2026.4.23 (a979721)

Root Cause

The blocking happens in provider-model-compat-D5P6lFk0.js line 36:

supportsReasoningEffort: !isZai && knownProviderFamily !== "mistral" && endpointClass !== "xai-native" && !usesExplicitProxyLikeEndpoint,

Path 1: Native endpoint (api.z.aiendpointClass: "zai-native")

  • isZai = endpointClass === "zai-native"true
  • supportsReasoningEffort = false (blocked by !isZai)
  • thinkingFormat is set to "zai" (line 39), but no code in the stream builder (provider-stream-rd4D2qfi.js) consumes thinkingFormat === "zai" — only "openrouter" is handled
  • Result: no thinking parameter sent

Path 2: Custom baseUrl (open.bigmodel.cnendpointClass: "custom")

This applies to Coding Plan (https://open.bigmodel.cn/api/coding/paas/v4) and CN endpoint (https://open.bigmodel.cn/api/paas/v4).

  • isZai = false (neither "zai-native" nor default route with zai provider)
  • usesConfiguredBaseUrl = true (endpointClass "custom""default")
  • usesKnownNativeOpenAIEndpoint = false (not openai-public/openai-codex/azure-openai)
  • usesExplicitProxyLikeEndpoint = true (configured && not known native)
  • supportsReasoningEffort = false (blocked by !usesExplicitProxyLikeEndpoint)
  • thinkingFormat falls to else branch → "openai" (not "zai"), but even "openai" isn't consumed either
  • Result: no thinking parameter sent

Why the stream builder doesn't help

In provider-stream-rd4D2qfi.js, the stream builder only has two thinking paths:

// Path A: OpenRouter
if (compat.thinkingFormat === "openrouter") {
  params.reasoning = { effort: ... };
}

// Path B: Standard OpenAI reasoning_effort
if (compat.supportsReasoningEffort && model.reasoning) {
  params.reasoning_effort = ...;
}

Zai matches neither path — thinkingFormat === "zai" has no handler, and supportsReasoningEffort is always false for zai.

Impact

  • All GLM models (glm-5.1, glm-5, glm-5-turbo, glm-4.7, etc.) run without any thinking/reasoning parameter
  • The binary thinking profile (off/low) registered by the zai extension (resolveThinkingProfile) only controls the UI toggle, not the actual API request
  • Users who set /thinking on see the UI change but no think/thinking/reasoning_effort parameter reaches the API
  • This is likely a regression — previously the full 5-level spectrum (off/minimal/low/medium/high) was available, and the thinking parameter was sent

Suggested Fix

  1. Add a thinkingFormat === "zai" handler in the stream builder that sends the appropriate 智谱 API thinking parameter (likely thinking or think in the request body)
  2. For the endpointClass: "custom" path, consider checking knownProviderFamily === "zai" in addition to endpointClass === "zai-native" so Coding Plan / CN endpoints aren't treated as generic proxies
  3. Consider adding open.bigmodel.cn to the zai manifest's providerEndpoints so the endpoint resolves as zai-native instead of custom

Key Files

FileRole
provider-model-compat-D5P6lFk0.jsisZai, supportsReasoningEffort, thinkingFormat logic
provider-attribution-DL72eDFq.jsendpointClass resolution (hardcoded hosts + manifest)
provider-stream-rd4D2qfi.jsStream builder — only handles openrouter and supportsReasoningEffort
extensions/zai/index.jsZai provider: binary thinking profile, no providerEndpoints in manifest

Environment

  • OS: Ubuntu 24.04 (x64), Linux 6.17.0-22-generic
  • Node: v24.14.0
  • Config: models.providers.zai.baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4", all models api: "openai-completions", all reasoning: true

extent analysis

TL;DR

The most likely fix is to add a handler for thinkingFormat === "zai" in the stream builder to send the appropriate thinking parameter to the API.

Guidance

  • Identify the stream builder code in provider-stream-rd4D2qfi.js and add a new condition to handle thinkingFormat === "zai".
  • Update the supportsReasoningEffort logic in provider-model-compat-D5P6lFk0.js to correctly handle endpointClass: "custom" for zai providers.
  • Consider adding open.bigmodel.cn to the zai manifest's providerEndpoints to resolve the endpoint as zai-native instead of custom.

Example

// Add a new condition to handle thinkingFormat === "zai"
if (compat.thinkingFormat === "zai") {
  params.thinking = { effort: ... }; // or params.think = ...
}

Notes

The suggested fix assumes that the thinking parameter for the zai API is either thinking or think. The actual parameter name may vary and should be verified against the zai API documentation.

Recommendation

Apply the suggested fix by adding a handler for thinkingFormat === "zai" in the stream builder, as this is the most direct way to address the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: zai provider: thinking/reasoning parameter never sent to API — affects all endpoints [1 participants]