openclaw - 💡(How to fix) Fix DeepSeek V4 thinking wrapper ignores thinkingFormat compat override, breaks Azure Foundry deployments

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…

The DeepSeek V4 OpenAI-Compatible Thinking Wrapper (createDeepSeekV4OpenAICompatibleThinkingWrapper) matches model IDs by pattern (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") and injects a thinking parameter into the request payload regardless of thinkingFormat compat overrides.

Root Cause

Setting reasoning: false, thinkingFormat: "openai", and supportsReasoningEffort: false has no effect — the wrapper still injects thinking because it matches the model ID pattern before checking compat.

Fix Action

Workaround

The Ollama cloud proxy path (ollama/deepseek-v4-flash:cloud) works because the Ollama provider doesn't trigger the DeepSeek V4 wrapper. Azure Foundry deployments are broken through the gateway with no config-level workaround.

Code Example

{
  "providers": {
    "microsoft-foundry": {
      "baseUrl": "https://will-5904-resource.services.ai.azure.com/openai/v1",
      "models": [
        {
          "id": "DeepSeek-V4-Flash",
          "reasoning": false,
          "compat": {
            "thinkingFormat": "openai",
            "supportsReasoningEffort": false
          }
        }
      ]
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

The DeepSeek V4 OpenAI-Compatible Thinking Wrapper (createDeepSeekV4OpenAICompatibleThinkingWrapper) matches model IDs by pattern (normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro") and injects a thinking parameter into the request payload regardless of thinkingFormat compat overrides.

Impact

Azure Foundry deployments of DeepSeek V4 models reject the thinking parameter entirely — even thinking: {type: "disabled"} returns 400 Unrecognized request argument supplied: thinking. This makes all Azure Foundry DeepSeek V4 models unusable through the gateway, even though they work fine via direct API calls and via the --local infer path.

Affected Config

{
  "providers": {
    "microsoft-foundry": {
      "baseUrl": "https://will-5904-resource.services.ai.azure.com/openai/v1",
      "models": [
        {
          "id": "DeepSeek-V4-Flash",
          "reasoning": false,
          "compat": {
            "thinkingFormat": "openai",
            "supportsReasoningEffort": false
          }
        }
      ]
    }
  }
}

Setting reasoning: false, thinkingFormat: "openai", and supportsReasoningEffort: false has no effect — the wrapper still injects thinking because it matches the model ID pattern before checking compat.

Steps to Reproduce

  1. Configure an Azure Foundry provider with a DeepSeek-V4-Flash deployment
  2. Set reasoning: false and thinkingFormat: "openai" in the model compat
  3. Run openclaw infer model run --model "microsoft-foundry/DeepSeek-V4-Flash" --prompt "Say OK" --gateway
  4. Observe: 400 Unrecognized request argument supplied: thinking
  5. Run the same with --local → works fine (no thinking param injected)

Expected Behavior

The thinkingFormat compat override should take priority over the auto-detected DeepSeek V4 pattern. When thinkingFormat: "openai" is set, the gateway should NOT inject thinking: {type: ...} — it should use the reasoning_effort format instead (or omit both when reasoning: false).

Alternatively, a new compat flag like thinkingFormat: "none" or suppressThinking: true should allow completely suppressing the thinking parameter.

Workaround

The Ollama cloud proxy path (ollama/deepseek-v4-flash:cloud) works because the Ollama provider doesn't trigger the DeepSeek V4 wrapper. Azure Foundry deployments are broken through the gateway with no config-level workaround.

Environment

  • OpenClaw: v2026.5.27 (27ae826)
  • Node: v24.15.0
  • OS: macOS Darwin 25.5.0 (arm64)
  • Provider: Azure AI Foundry (services.ai.azure.com)

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