Skip to content

bug(opencode-go): DeepSeek V4 models silently drop max/xhigh thinking level due to missing thinkingLevelMap #99601

Closed

Description

@34262315716

Bug: opencode-go plugin silently drops max thinking level for DeepSeek V4 models

Summary

The opencode-go provider plugin defines DeepSeek V4 models (deepseek-v4-flash and deepseek-v4-pro) without a thinkingLevelMap in its model catalog. This causes getSupportedThinkingLevels() to exclude xhigh and max from the available thinking levels for these models. When a user runs /think max, OpenClaw silently clamps it down to high, so the DeepSeek V4 API never receives reasoning_effort: "max".

Root Cause

In extensions/opencode-go/provider-catalog.ts (compiled to dist/provider-catalog-4xldE6UI.js), the DeepSeek V4 model entries are defined as:

{
  id: "deepseek-v4-pro",
  name: "DeepSeek V4 Pro",
  api: "openai-completions",
  provider: PROVIDER_ID,
  baseUrl: OPENCODE_GO_OPENAI_BASE_URL,
  reasoning: true,
  // ... cost, contextWindow, etc.
  compat: {
    supportsUsageInStreaming: true,
    supportsReasoningEffort: true,
    maxTokensField: "max_tokens"
  }
  // ❌ No thinkingLevelMap
}

The critical function getSupportedThinkingLevels() in sanitize-unicode-DcA7E1vi.js has special handling for xhigh and max:

function getSupportedThinkingLevels(model) {
  const thinkingLevelMap = resolveThinkingLevelMap(model);
  return EXTENDED_THINKING_LEVELS.filter((level) => {
    const mapped = thinkingLevelMap?.[level];
    if (mapped === null) return false;
    if (level === "xhigh" || level === "max") return mapped !== void 0; // ← requires thinkingLevelMap entry
    return true;
  });
}

When thinkingLevelMap is undefined (which is the case for opencode-go DeepSeek V4 models):

  • xhigh → undefined !== void 0 → false → excluded ❌
  • max → undefined !== void 0 → false → excluded ❌

This causes the clamp chain:

  1. getSupportedThinkingLevels() → returns ["off", "minimal", "low", "medium", "high"]
  2. clampThinkingLevel(model, "max") → "max" not available → steps down to "high"
  3. streamSimpleOpenAICompletions → sends reasoning_effort: "high"
  4. DeepSeek V4 API never receives the "max" reasoning effort the user requested

Why the official deepseek provider plugin works correctly

The @openclaw/deepseek-provider plugin has its own createDeepSeekV4ThinkingWrapper in provider-stream-shared-C_b_e9Jg.js that bypasses the generic thinking path:

function resolveDeepSeekV4ReasoningEffort(thinkingLevel) {
  return thinkingLevel === "xhigh" || thinkingLevel === "max" ? "max" : "high";
}

It also sends the DeepSeek-specific thinking: { type: "enabled" } payload control.

Impact

Users of opencode-go/deepseek-v4-flash or opencode-go/deepseek-v4-pro cannot use max thinking intensity, even though DeepSeek V4 models support reasoning_effort: "max" natively. The /think max command silently falls back to high without any user-visible warning.

Affected Models

  • opencode-go/deepseek-v4-flash
  • opencode-go/deepseek-v4-pro (and potentially other reasoning models in the opencode-go catalog)

Suggested Fix

Add a thinkingLevelMap to the DeepSeek V4 model entries in extensions/opencode-go/provider-catalog.ts:

{
  id: "deepseek-v4-pro",
  name: "DeepSeek V4 Pro",
  api: "openai-completions",
  provider: PROVIDER_ID,
  baseUrl: OPENCODE_GO_OPENAI_BASE_URL,
  reasoning: true,
  thinkingLevelMap: {
    off: null,
    minimal: "low",
    low: "low",
    medium: "medium",
    high: "high",
    xhigh: "max",
    max: "max"
  },
  // ...
}

Additionally, consider whether compat.thinkingFormat: "deepseek" and the DeepSeek-specific thinking: { type: "enabled/disabled" } payload should be used, since DeepSeek V4 models expect it for proper thinking control.

Environment

  • OpenClaw version: 2026.6.11 (e085fa1)
  • Models affected: opencode-go/deepseek-v4-flash, opencode-go/deepseek-v4-pro
  • User's thinkingDefault: "max" is set

Activity

  1. clawsweeper commented on Jul 3, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 18, 2026, 12:47 AM ET / 04:47 UTC.

    Summary
    Keep this issue open because the open, proof-positive implementation PR #99643 explicitly targets the reported OpenCode Go DeepSeek V4 thinking-level gap; it should resolve through normal PR review and merge rather than be closed early.

    Reproducibility: unclear. The supplied issue and linked PR describe a concrete affected-model path and focused tests, but this read-only review could not independently execute or inspect the current-main reproduction path.

    Root-cause cluster
    Relationship: canonical
    Canonical: #99601
    Summary: This issue is the canonical report for the active candidate fix; the related issue reports the same capability gap, while the broader clamp-observability request is adjacent rather than the same root cause.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Include the exact command, prompt, or workflow that triggered it.
    • Add expected vs actual behavior.

    Next step
    A viable open PR already owns the implementation, so the maintainer action is to review its current head and merge it if its focused compatibility and CI proof remain sound.

    Review details

    Best possible solution:

    Land a focused provider-owned policy and stream mapping fix that exposes all supported DeepSeek V4 levels in both cold control-plane and runtime paths without changing existing low, medium, or high semantics; handle generic clamp observability separately in #106009.

    Do we have a high-confidence way to reproduce the issue?

    Unclear. The supplied issue and linked PR describe a concrete affected-model path and focused tests, but this read-only review could not independently execute or inspect the current-main reproduction path.

    Is this the best way to solve the issue?

    Yes, conditionally. The linked provider-owned policy approach is narrower than changing generic thinking behavior, provided it keeps existing low/medium/high mappings intact and validates pre-runtime control-plane resolution.

    AGENTS.md: unclear because the file could not be read completely.

    Remaining risk / open question:

    Codex review notes: model internal, reasoning high; reviewed against 4e0cc187a21c.

    Label changes

    Label changes:

    • add P2: The reported provider capability mismatch affects DeepSeek V4 users of one optional provider integration but does not establish an urgent cross-runtime outage.
    • add impact:auth-provider: The problem concerns provider model capability metadata and how requested reasoning effort is routed.
    • add issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.
    • add clawsweeper:needs-info: Current issue advisory state selects this label.
    • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.
    • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.

    Label justifications:

    • P2: The reported provider capability mismatch affects DeepSeek V4 users of one optional provider integration but does not establish an urgent cross-runtime outage.
    • impact:auth-provider: The problem concerns provider model capability metadata and how requested reasoning effort is routed.
    Evidence reviewed

    What I checked:

    • Open implementation candidate: The linked open PR states that it fixes this issue and covers both the cold provider-policy path and runtime request mapping, including preserving low, medium, and high effort behavior. (bc3a64e89243)
    • Linked PR has positive proof signal: The provided GitHub context marks fix(opencode-go): expose DeepSeek V4 max thinking levels #99643 as proof: sufficient and reports focused regression coverage for catalog mapping, stream payload mapping, and pre-runtime provider-policy resolution. (bc3a64e89243)
    • Canonical related-report distinction: opencode-go: DeepSeek V4 xhigh/max thinking levels not selectable #99617 describes the same unavailable xhigh/max OpenCode Go DeepSeek V4 behavior, while this issue is the one explicitly referenced by the viable open PR; retaining this issue avoids closing a report before its candidate fix merges.

    Likely related people:

    • mushuiyu886: Authored the active PR that wires the provider-owned thinking policy for the exact affected models and control-plane path. (role: linked implementation contributor; confidence: medium; commits: bc3a64e89243; files: extensions/opencode-go/provider-policy-api.ts, extensions/opencode-go/index.test.ts, src/plugins/provider-public-artifacts.test.ts)
    • 34262315716: Reported this behavior and authored the related provider-profile proposal, supplying the original affected-model and thinking-level investigation. (role: reporter and related-fix contributor; confidence: medium; commits: 30829ecbb32e; files: extensions/opencode-go/thinking.ts, extensions/opencode-go/index.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. openclaw-barnacle commented on Jul 18, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  3. added
    stale
    on Jul 18, 2026
  4. added
    P2
    impact:auth-provider
    issue-rating: 🦐 gold shrimp
    clawsweeper:needs-info
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    on Jul 18, 2026
  5. locked as resolved and limited conversation to collaborators on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:fix-shape-clearclawsweeper:linked-pr-openclawsweeper:needs-infoclawsweeper:needs-maintainer-reviewclawsweeper:no-new-fix-primpact:auth-providerissue-rating: 🦐 gold shrimpstale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions