Skip to content

[Bug] SiliconFlow Pro/* models fail with thinking=off (400) and trigger compaction loop / [问题] SiliconFlow Pro/* 模型在 thinking=off 时 400 并触发压缩循环 #25433

@Zjianru

Description

@Zjianru

中文

问题描述

在 OpenClaw 2026.2.23 中,使用 siliconflow provider 的 Pro/* 模型时,如果会话 thinking 为 off,embedded run 会稳定返回 400 status code (no body),随后触发 compaction/retry,导致 WebUI 看起来“每发一条就 compact 一次”。

这不是实际上下文溢出:fresh session 下 tokensBefore 很低(例如 121、15)也会触发。

影响模型(已实测)

  • Pro/deepseek-ai/DeepSeek-V3.2
  • Pro/zai-org/GLM-4.7
  • Pro/MiniMaxAI/MiniMax-M2.1
  • Pro/moonshotai/Kimi-K2.5

复现步骤

  1. 配置 siliconflow provider(api: "openai-completions")并将主模型设置为任一 Pro/*
  2. 使用默认 thinking off(例如 agents.defaults.thinkingDefault: "off")。
  3. 在 WebUI 或本地 embedded run 发起一次普通对话。
  4. 观察 gateway log:embedded run start ... thinking=off 后紧跟 isError=true error=400 status code (no body),随后 compaction start/retry。

日志特征(精简)

  • embedded run start: ... provider=siliconflow model=Pro/... thinking=off
  • embedded run agent end: ... isError=true error=400 status code (no body)
  • embedded run compaction start ...

API 对照证据(同一 API Key)

对上述 4 个模型均一致:

  • 不带 thinking -> 200
  • thinking: "off" -> 400code: 20015, The parameter is invalid. Please check again.
  • thinking: null -> 200

期望行为

provider=siliconflow 且模型为 Pro/* 时,thinking=off 不应导致 400;应避免进入误导性的 compaction 重试路径。

建议修复

在 payload 发送前做 provider/model 兼容处理:

  • 条件:provider === "siliconflow" && modelId.startsWith("Pro/") && thinkingLevel === "off"
  • 行为:将 payload 中 thinking: "off" 归一为 thinking: null

这样可保持“关闭 thinking”的语义,同时兼容 SiliconFlow 参数校验。


English

Description

On OpenClaw 2026.2.23, when using siliconflow Pro/* models, embedded runs fail with 400 status code (no body) whenever thinking is off. The runtime then enters compaction/retry, so WebUI appears to compact on every message.

This is not a real context overflow. Even in fresh sessions with low tokensBefore (e.g. 121, 15), the same loop occurs.

Affected models (verified)

  • Pro/deepseek-ai/DeepSeek-V3.2
  • Pro/zai-org/GLM-4.7
  • Pro/MiniMaxAI/MiniMax-M2.1
  • Pro/moonshotai/Kimi-K2.5

Reproduction

  1. Configure siliconflow provider (api: "openai-completions") and set any Pro/* model as primary.
  2. Keep thinking at off (for example agents.defaults.thinkingDefault: "off").
  3. Send a normal message from WebUI (or embedded local run).
  4. Observe logs: embedded run start ... thinking=off -> isError=true error=400 status code (no body) -> compaction start/retry.

Log signature (short)

  • embedded run start: ... provider=siliconflow model=Pro/... thinking=off
  • embedded run agent end: ... isError=true error=400 status code (no body)
  • embedded run compaction start ...

API comparison evidence (same API key)

For all four models above:

  • Without thinking -> 200
  • With thinking: "off" -> 400 (code: 20015, The parameter is invalid. Please check again.)
  • With thinking: null -> 200

Expected behavior

For provider=siliconflow and Pro/* models, thinking=off should not cause HTTP 400 and should not trigger compaction retry flow.

Proposed fix

Add a provider/model compatibility shim before payload send:

  • Condition: provider === "siliconflow" && modelId.startsWith("Pro/") && thinkingLevel === "off"
  • Behavior: normalize payload thinking: "off" to thinking: null

This preserves the "thinking disabled" intent while matching SiliconFlow's payload validation behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions