openclaw - ✅(Solved) Fix DeepSeek provider plugin missing resolveThinkingProfile — /think max/xhigh rejected on deepseek-v4-pro despite full backend support [1 pull requests, 1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#72893Fetched 2026-04-28 06:30:43
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
1
Timeline (top)
commented ×1cross-referenced ×1

The bundled deepseek provider plugin in OpenClaw v2026.4.25 stable does not register a resolveThinkingProfile() hook, which causes /think max and /think xhigh to be rejected for deepseek/deepseek-v4-pro and deepseek/deepseek-v4-flash, even though:

  1. DeepSeek's official API supports both (docs): reasoning_effort: "high" | "max", with xhigh auto-mapped to max.
  2. OpenClaw's stream wrapper already supports it: provider-stream-shared-CMqu78qu.js:157 correctly maps xhigh/max to max for DeepSeek payloads.
  3. The thinking ranks already include them: THINKING_LEVEL_RANKS in thinking-enE1knZM.js defines xhigh: 60, max: 70.

The only missing piece is the provider plugin not exposing resolveThinkingProfile, which causes resolveThinkingProfile() (in thinking-enE1knZM.js) to fall back to buildBaseThinkingProfile() returning only ["off", "minimal", "low", "medium", "high"].

Related closed issue: #71584 covered the same root cause for ollama/deepseek-v4-flash:cloud, but the native DeepSeek provider plugin was not patched.

Root Cause

dist/extensions/deepseek/index.js (48 lines total) is missing the resolveThinkingProfile hook that other reasoning-capable providers register. Compare:

  • extensions/anthropic/register.runtime.js:388 — registers profile
  • extensions/google/provider-hooks.js:7 — registers profile
  • extensions/xai/index.js:134 — registers profile
  • extensions/moonshot/index.js:51 — registers profile
  • extensions/mistral/index.js:46 — registers profile
  • extensions/zai/index.js:244 — registers profile
  • extensions/kimi-coding/index.js:80 — registers profile
  • extensions/codex/provider.js:39 — registers profile
  • extensions/github-copilot/index.js:112 — registers profile
  • extensions/amazon-bedrock/register.sync.runtime.js:247 — registers profile
  • extensions/deepseek/index.jsmissing

Fix Action

Fix / Workaround

Related closed issue: #71584 covered the same root cause for ollama/deepseek-v4-flash:cloud, but the native DeepSeek provider plugin was not patched.

Local Workaround

Patched dist/extensions/deepseek/index.js to add the missing resolveThinkingProfile and confirmed /think max and /think xhigh are accepted, the streamed payload reaches DeepSeek with reasoning_effort: "max", and reasoning_content is returned correctly.

PR fix notes

PR #73008: fix(deepseek): expose V4 max thinking levels

Description (problem / solution / changelog)

Summary

  • Problem: Native deepseek/deepseek-v4-pro and deepseek/deepseek-v4-flash rejected /think max and /think xhigh before request construction.
  • Why it matters: DeepSeek V4 stream handling already maps max reasoning requests, but users could not select those levels through OpenClaw thinking validation.
  • What changed: Added a DeepSeek V4 resolveThinkingProfile with off|minimal|low|medium|high|xhigh|max, added regression coverage, and documented the supported levels.
  • What did NOT change (scope boundary): No OpenRouter behavior, no core thinking resolver changes, no changelog entry.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #72893
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: The DeepSeek provider registered the V4 stream wrapper, but did not expose a provider resolveThinkingProfile, so thinking validation fell back to the base levels only.
  • Missing detection / guardrail: Existing DeepSeek tests covered payload mapping after a level was accepted, but not provider-profile level exposure.
  • Contributing context (if known): DeepSeek V4 request shaping already handled xhigh/max via the stream wrapper.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: extensions/deepseek/index.test.ts
  • Scenario the test should lock in: DeepSeek V4 models expose xhigh and max; non-V4 DeepSeek models do not opt into the V4 profile.
  • Why this is the smallest reliable guardrail: The bug was in provider profile registration, so the provider plugin test directly exercises the missing hook.
  • Existing test that already covers this (if any): Existing tests covered V4 payload mapping, not level acceptance.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

/think xhigh and /think max are accepted for native DeepSeek V4 Flash and Pro models.

Diagram (if applicable)

Before:
[/think max] -> [DeepSeek provider has no profile] -> [base levels only] -> [rejected]

After:
[/think max] -> [DeepSeek V4 profile] -> [max accepted] -> [stream wrapper maps request]

Additional live test result:

DEEPSEEK_LIVE_TEST=1 OPENCLAW_LIVE_DEEPSEEK_MODEL=deepseek-v4-pro pnpm test:live extensions/deepseek/deepseek.live.test.ts -- --reporter=verbose

RUN  v4.1.5

✓ extensions/deepseek/deepseek.live.test.ts > deepseek plugin live > returns assistant text from the bundled V4 model catalog 1103ms
✓ extensions/deepseek/deepseek.live.test.ts > deepseek plugin live > accepts V4 thinking replay after a prior provider tool call 1299ms

Test Files  1 passed (1)
Tests       2 passed (2)
Duration    5.18s

Changed files

  • docs/providers/deepseek.md (modified, +2/-0)
  • docs/tools/thinking.md (modified, +1/-0)
  • extensions/deepseek/index.test.ts (modified, +31/-0)
  • extensions/deepseek/index.ts (modified, +21/-4)

Code Example

/model deepseek/deepseek-v4-pro
/think max
Thinking level "max" is not supported for deepseek/deepseek-v4-pro. Use one of: off, minimal, low, medium, high.

/think xhigh
Thinking level "xhigh" is not supported for deepseek/deepseek-v4-pro. Use one of: off, minimal, low, medium, high.

---

resolveThinkingProfile: ({ modelId }) => {
    const lower = modelId.toLowerCase();
    if (lower === "deepseek-v4-flash" || lower === "deepseek-v4-pro") {
        return {
            levels: [
                { id: "off", label: "off" },
                { id: "minimal", label: "minimal" },
                { id: "low", label: "low" },
                { id: "medium", label: "medium" },
                { id: "high", label: "high" },
                { id: "xhigh", label: "xhigh" },
                { id: "max", label: "max" }
            ],
            defaultLevel: "high"
        };
    }
},
RAW_BUFFERClick to expand / collapse

Summary

The bundled deepseek provider plugin in OpenClaw v2026.4.25 stable does not register a resolveThinkingProfile() hook, which causes /think max and /think xhigh to be rejected for deepseek/deepseek-v4-pro and deepseek/deepseek-v4-flash, even though:

  1. DeepSeek's official API supports both (docs): reasoning_effort: "high" | "max", with xhigh auto-mapped to max.
  2. OpenClaw's stream wrapper already supports it: provider-stream-shared-CMqu78qu.js:157 correctly maps xhigh/max to max for DeepSeek payloads.
  3. The thinking ranks already include them: THINKING_LEVEL_RANKS in thinking-enE1knZM.js defines xhigh: 60, max: 70.

The only missing piece is the provider plugin not exposing resolveThinkingProfile, which causes resolveThinkingProfile() (in thinking-enE1knZM.js) to fall back to buildBaseThinkingProfile() returning only ["off", "minimal", "low", "medium", "high"].

Related closed issue: #71584 covered the same root cause for ollama/deepseek-v4-flash:cloud, but the native DeepSeek provider plugin was not patched.

Reproduction

OpenClaw v2026.4.25 stable, native DeepSeek provider via API key:

/model deepseek/deepseek-v4-pro
/think max
→ Thinking level "max" is not supported for deepseek/deepseek-v4-pro. Use one of: off, minimal, low, medium, high.

/think xhigh
→ Thinking level "xhigh" is not supported for deepseek/deepseek-v4-pro. Use one of: off, minimal, low, medium, high.

Direct DeepSeek API call with reasoning_effort: "max" works without issue (confirmed against official docs).

Root Cause

dist/extensions/deepseek/index.js (48 lines total) is missing the resolveThinkingProfile hook that other reasoning-capable providers register. Compare:

  • extensions/anthropic/register.runtime.js:388 — registers profile
  • extensions/google/provider-hooks.js:7 — registers profile
  • extensions/xai/index.js:134 — registers profile
  • extensions/moonshot/index.js:51 — registers profile
  • extensions/mistral/index.js:46 — registers profile
  • extensions/zai/index.js:244 — registers profile
  • extensions/kimi-coding/index.js:80 — registers profile
  • extensions/codex/provider.js:39 — registers profile
  • extensions/github-copilot/index.js:112 — registers profile
  • extensions/amazon-bedrock/register.sync.runtime.js:247 — registers profile
  • extensions/deepseek/index.jsmissing

Suggested Fix

Add resolveThinkingProfile to the DeepSeek provider definition in extensions/deepseek/index.ts, between wrapStreamFn and isModernModelRef:

resolveThinkingProfile: ({ modelId }) => {
    const lower = modelId.toLowerCase();
    if (lower === "deepseek-v4-flash" || lower === "deepseek-v4-pro") {
        return {
            levels: [
                { id: "off", label: "off" },
                { id: "minimal", label: "minimal" },
                { id: "low", label: "low" },
                { id: "medium", label: "medium" },
                { id: "high", label: "high" },
                { id: "xhigh", label: "xhigh" },
                { id: "max", label: "max" }
            ],
            defaultLevel: "high"
        };
    }
},

This matches DeepSeek's documented behavior:

  • low/medium → auto-mapped to high server-side
  • xhigh → auto-mapped to max server-side
  • high/max → sent through as-is

The existing createDeepSeekV4OpenAICompatibleThinkingWrapper already handles the payload mapping correctly; this change is purely about letting /think and agents.defaults.thinking accept xhigh/max as valid levels.

Environment

  • OpenClaw: 2026.4.25 (aa36ee6) — latest stable
  • OS: Ubuntu 24.04 LTS (aarch64), Oracle Cloud VPS
  • Node: v24.14.1
  • Provider: native DeepSeek (api-key auth, https://api.deepseek.com)
  • Model: deepseek-v4-pro

Local Workaround

Patched dist/extensions/deepseek/index.js to add the missing resolveThinkingProfile and confirmed /think max and /think xhigh are accepted, the streamed payload reaches DeepSeek with reasoning_effort: "max", and reasoning_content is returned correctly.

extent analysis

TL;DR

Add the resolveThinkingProfile hook to the DeepSeek provider definition in extensions/deepseek/index.ts to enable support for /think max and /think xhigh commands.

Guidance

  • Verify that the resolveThinkingProfile hook is missing from dist/extensions/deepseek/index.js by comparing it with other reasoning-capable providers.
  • Add the suggested resolveThinkingProfile function to extensions/deepseek/index.ts to enable support for xhigh and max thinking levels.
  • Confirm that the change allows /think max and /think xhigh commands to be accepted and the streamed payload to reach DeepSeek with reasoning_effort: "max".
  • Test the fix by running the /think max and /think xhigh commands and verifying that the response from DeepSeek includes the expected reasoning_content.

Example

resolveThinkingProfile: ({ modelId }) => {
    const lower = modelId.toLowerCase();
    if (lower === "deepseek-v4-flash" || lower === "deepseek-v4-pro") {
        return {
            levels: [
                { id: "off", label: "off" },
                { id: "minimal", label: "minimal" },
                { id: "low", label: "low" },
                { id: "medium", label: "medium" },
                { id: "high", label: "high" },
                { id: "xhigh", label: "xhigh" },
                { id: "max", label: "max" }
            ],
            defaultLevel: "high"
        };
    }
},

Notes

This fix assumes that the createDeepSeekV4OpenAICompatibleThinkingWrapper function already handles the payload mapping correctly. If issues persist, further investigation into the payload mapping may be necessary.

Recommendation

Apply the suggested workaround by adding

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 - ✅(Solved) Fix DeepSeek provider plugin missing resolveThinkingProfile — /think max/xhigh rejected on deepseek-v4-pro despite full backend support [1 pull requests, 1 comments, 2 participants]