Skip to content

[Bug]: OpenClaw 2026.3.12: Thinking models (reasoning: true) timeout across multiple providers (zai/glm-5, minimax-portal) #45681

Description

@lhtpluto

Bug type

Regression (worked before, now fails)

Summary

Issue Body
Description
After upgrading from OpenClaw 2026.3.8 to 2026.3.12, models with reasoning: true frequently timeout, triggering fallback or surfacing errors. This affects multiple providers.

Affected Models
| Provider | Model ID | reasoning | API Format | Status |
|----------|------------|--------|
| zai | glm-5 | true | openai-completions | ⚠️ Timeout |
| zai | glm-4.7 | true | openai-completions | ⚠️ Timeout |
| minimax-portal | MiniMax-M2.5-highspeed | true | anthropic-messages | ⚠️ Timeout |
| minimax-portal | MiniMax-M2.5-Lightning | true | anthropic-messages | ⚠️ Timeout |
| minimax-portal | MiniMax-M2.5 | false | anthropic-messages | ✅ Works |

Error Logs
zai/glm-5 (OpenAI-compatible API)
2026-03-14T08:32:19.504+08:00 [agent/embedded] embedded run agent end: runId=d4c930d0-9d3d-47c4-aa36-d22bf6983399 isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T08:32:19.527+08:00 [agent/embedded] embedded run failover decision: runId=d4c930d0-9d3d-47c4-aa36-d22bf6983399 stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36

2026-03-14T08:37:51.892+08:00 [agent/embeded] embedded run agent end: runId=7d2b5f3a-14de-42ff-b108-da48205b21e5 isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T08:37:51.915+08:00 [agent/embedded] embedded run failover decision: runId=7d2b5f3a-14de-42ff-b108-da48205b21e5 stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36

2026-03-14T08:40:50.289+08:00 [agent/embeded] embedded run agent end: runId=c2a40dff-91d8-4eff-b1ab-6d87ad641e54 isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T08:40:50.312+08:00 [agent/embedded] embedded run failover decision: runId=c2a40dff-91d8-4eff-b1ab-6d87ad641e54 stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36

2026-03-14T09:30:46.822+08:00 [agent/embeded] embedded run agent end: runId=d6269439-8945-4a8c-a2e0-ea1fd0209862 isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T09:30:46.841+08:00 [agent/embedded] embedded run failover decision: runId=d6269439-8945-4a8c-a2e0-ea1fd0209862 stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36

2026-03-14T09:32:30.565+08:00 [agent/embedded] embedded run agent end: runId=b10a9f60-9d0d-4d80-aa14-4a086d0cbd65 isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T09:32:30.593+08:00 [agent/embedded] embedded run failover decision: runId=b10a9f60-9d0d-4d80-aa14-4a086d0cbd65 stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36

2026-03-14T09:35:02.842+08:00 [agent/embeded] embedded run agent end: runId=59264d2d-1dfc-4cff-996e-10ce41f25e8b isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T09:35:02.858+08:00 [agent/embedded] embedded run failover decision: runId=59264d2d-1dfc-4cff-996e-10ce41f25e8b stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36

2026-03-14T09:36:52.412+08:00 [agent/embedded] embedded run agent end: runId=2058abfe-8223-4ca3-8fe3-353c88343279 isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T09:36:52.434+08:00 [agent/embeded] embedded run failover decision: runId=2058abfe-8223-4ca3-8fe3-353c88343279 stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36

2026-03-14T10:21:26.689+08:00 [agent/embeded] embedded run agent end: runId=3b6f0fdd-51a9-4b06-a916-f536a73863e2 isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T10:21:26.717+08:00 [agent/embedded] embedded run failover decision: runId=3b6f0fdd-51a9-4b06-a916-f536a73863e2 stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36

2026-03-14T10:33:39.579+08:00 [agent/embedded] embedded run agent end: runId=b9a96abf-5f66-42ba-8a6f-5468f49a5f46 isError=true model=glm-5 provider=zai error=LLM request timed out.
2026-03-14T10:33:39.603+08:00 [agent/embeded] embedded run failover decision: runId=b9a96abf-5f66-42ba-8a6f-5468f49a5f46 stage=assistant decision=surface_error reason=timeout provider=zai/glm-5 profile=sha256:118886372c36
minimax-portal/MiniMax-M2.5-highspeed (Anthropic-compatible API)
2026-03-14T10:44:09.986+08:00 [agent/embeded] embedded run failover decision: runId=slug-gen-177345623467 stage=assistant decision=fallback_model reason=timeout provider=minimax-portal/MiniMax-M2.5-highspeed profile=sha256:9e08bd6be9c1
``

Pattern Analysis

Key observation: Only models with reasoning: true timeout. Models with reasoning: false work correctly.

Two different API formats affected:

  1. OpenAI-completions (zai/glm-5) → decision=surface_error (no fallback configured)
  2. Anthropic-messages (minimax-portal) → decision=fallback_model (fallback configured)

Environment

  • OpenClaw Version: 2026.3.12 (upgraded from 2026.3.8)
  • OS: macOS 15 (Darwin 25.3.0 arm64)
  • Node: v24.14.0
  • Default Model: minimax-portal/MiniMax-M2.5-highspeed

Root Cause Analysis

From code inspection:

  1. Thinking models emit extra stream events (thinking_start, thinking_delta, thinking_end) that require special handling

  2. 2026.3.12 CHANGELOG mentions thinking-related fixes but only for specific providers:

    "Ollama/Kimi Cloud: apply the Moonshot Kimi payload compatibility wrapper to Ollama-hosted Kimi models like kimi-k2.5:cloud, so tool routing no longer breaks when thinking is enabled." ([Bug]:fix(ollama): kimi-k2.5:cloud tool routing fails - extend fix to all Kimi variants #41519)

  3. zai provider uses createZaiToolStreamWrapper but may not have thinking-specific handling:

    if (provider === "zai" || provider === "z-ai") {
      if (merged?.tool_stream !== false) {
        agent.streamFn = createZaiToolStreamWrapper(agent.streamFn, true);
      }
    }

MiniMax portal has no thinking wrapper (unlike Moonshot which has createMoonshotThinkingWrapper)

Neither zai nor minimax-portal have entries in PROVIDER_CAPABILITIES for thinking signature handling

Workaround
Set reasoning: false in model config:

{
"id": "MiniMax-M2.5-highspeed",
"reasoning": false
}
Or use models without reasoning enabled.

Suggested Fix
Add thinking stream event handling for zai provider (OpenAI-compatible reasoning models)
Add minimax-portal to PROVIDER_CAPABILITIES with appropriate thinking handling
Consider a generic thinking wrapper for providers using Anthropic-compatible APIs without native thinking support
Related
#41519 (Moonshot/Kimi thinking fix)
#38669, #39907, #40552 (Kimi Coding tool_use fix)
src/agents/provider-capabilities.ts
src/agents/pi-embedded-runner/stream-wrappers.ts

Steps to reproduce

Pattern Analysis
模式分析
Key observation: Only models with reasoning: true timeout.

关键发现: 只有 reasoning: true 的模型会超时。

Models with reasoning: false work correctly.

reasoning: false 的模型正常工作。

Two different API formats affected:

影响两种不同的 API 格式:

OpenAI-completions (zai/glm-5) → decision=surface_error (no fallback configured)

OpenAI-completions(zai/glm-5)→ decision=surface_error(未配置降级)

Anthropic-messages (minimax-portal) → decision=fallback_model (fallback configured)

Anthropic-messages(minimax-portal)→ decision=fallback_model(已配置降级)

Expected behavior

Suggested Fix
建议修复
Add thinking stream event handling for zai provider (OpenAI-compatible reasoning models)

为 zai 提供商添加 thinking 流事件处理(OpenAI 兼容的 reasoning 模型)

Add minimax-portal to PROVIDER_CAPABILITIES with appropriate thinking handling

将 minimax-portal 添加到 PROVIDER_CAPABILITIES,并配置适当的 thinking 处理

Consider a generic thinking wrapper for providers using Anthropic-compatible APIs without native thinking support

考虑为使用 Anthropic 兼容 API 但无原生 thinking 支持的提供商添加通用的 thinking 包装器

Actual behavior

Pattern Analysis
模式分析
Key observation: Only models with reasoning: true timeout.

关键发现: 只有 reasoning: true 的模型会超时。

Models with reasoning: false work correctly.

reasoning: false 的模型正常工作。

Two different API formats affected:

影响两种不同的 API 格式:

OpenAI-completions (zai/glm-5) → decision=surface_error (no fallback configured)

OpenAI-completions(zai/glm-5)→ decision=surface_error(未配置降级)

Anthropic-messages (minimax-portal) → decision=fallback_model (fallback configured)

Anthropic-messages(minimax-portal)→ decision=fallback_model(已配置降级)

OpenClaw version

2026.3.12

Operating system

macos 26.3.1

Install method

No response

Model

zai/glm-5, zai/glm-4.7, minimax-portal/MiniMax-M2.5-highspeed, minimax-portal/MiniMax-M2.5-Lightning

Provider / routing chain

openclaw → zai (Zhipu GLM API) and openclaw → minimax-portal (MiniMax Anthropic API)

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions