Repository navigation
Description
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:
getSupportedThinkingLevels()→ returns["off", "minimal", "low", "medium", "high"]clampThinkingLevel(model, "max")→ "max" not available → steps down to "high"streamSimpleOpenAICompletions→ sendsreasoning_effort: "high"- 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-flashopencode-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
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 3, 2026
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:
canonicalCanonical: #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:
fixed_by_candidate: fix(opencode-go): expose DeepSeek V4 max thinking levels #99643 - The open PR explicitly targets this issue's DeepSeek V4 model capability and cold control-plane policy gap.duplicate: opencode-go: DeepSeek V4 xhigh/max thinking levels not selectable #99617 - It reports the same OpenCode Go DeepSeek V4 inability to selectxhighandmax, with overlapping affected models and root cause.adjacent_distinct: Effort/thinking level clamps are silent across all providers (no warning when xhigh/max is reduced) #106009 - It concerns user-visible diagnostics for clamping across providers, not whether these OpenCode Go models declare and route supported elevated levels.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Ways to help us reproduce this
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, orhighsemantics; 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/highmappings intact and validates pre-runtime control-plane resolution.AGENTS.md: unclear because the file could not be read completely.
Remaining risk / open question:
main.Codex review notes: model internal, reasoning high; reviewed against 4e0cc187a21c.
Label changes
Label changes:
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.issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.clawsweeper:needs-info: Current issue advisory state selects this label.clawsweeper:linked-pr-open: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.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:
low,medium, andhigheffort behavior. (bc3a64e89243)proof: sufficientand reports focused regression coverage for catalog mapping, stream payload mapping, and pre-runtime provider-policy resolution. (bc3a64e89243)xhigh/maxOpenCode 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:
extensions/opencode-go/provider-policy-api.ts,extensions/opencode-go/index.test.ts,src/plugins/provider-public-artifacts.test.ts)extensions/opencode-go/thinking.ts,extensions/opencode-go/index.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.openclaw-barnacle commentedon Jul 18, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.