Repository navigation
Description
Problem
OpenClaw 的 thinking level 选择器对大部分模型只能显示 minimum ~ high 级别,xhigh 和 max 选项因为 getSupportedThinkingLevels() 的过滤逻辑不会被显示。
但 opencode-go 的 DeepSeek V4 (deepseek-v4-pro / deepseek-v4-flash) 实际通过 API 支持 reasoning_effort: "max",用户应当能选择到 xhigh/max 并发出对应的 reasoning_effort。
Root Cause
这是个双重问题,两个环节都需要修复才能让用户完整使用 reasoning 能力:
1. Catalog 缺少 thinkingLevelMap
extensions/opencode-go/provider-catalog.ts 中两个 DeepSeek V4 模型定义没有声明 thinkingLevelMap。getSupportedThinkingLevels() 依赖此字段来确定模型支持哪些 thinking level;没有声明时默认只有 minimum ~ high。
2. Stream wrapper 硬编码 reasoning_effort 映射
extensions/opencode-go/stream.ts 使用 createDeepSeekV4OpenAICompatibleThinkingWrapper,其内部用 resolveDeepSeekV4ReasoningEffort 硬编码了 reasoning_effort 映射,完全不读取模型的 thinkingLevelMap 配置。即使 catalog 声明了 map,wrapper 也不会使用它。
Fix
两个文件一起修:
-
provider-catalog.ts: 为
deepseek-v4-pro和deepseek-v4-flash新增thinkingLevelMap,映射minimal/low/medium → "high",high/xhigh/max → "max" -
stream.ts: 将硬编码的
createDeepSeekV4OpenAICompatibleThinkingWrapper替换为内联的streamWithPayloadPatch逻辑,运行时读取model.thinkingLevelMap决定 reasoning_effort 值
Related
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 3, 2026, 2:31 PM ET / 18:31 UTC.
Summary
Keep open: current main and v2026.6.11 still lack the opencode-go DeepSeek V4 metadata needed to expose xhigh/max, and the linked closing PR is open and not merge-ready.
Reproducibility: yes. by source inspection: current main lacks thinkingLevelMap for the two opencode-go DeepSeek V4 models, and getSupportedThinkingLevels hides xhigh/max when those entries are absent. I did not run a live opencode-go API request in this read-only review.
Root-cause cluster
Relationship:
canonicalCanonical: #99617
Summary: This issue is the active canonical report because it has the open closing PR and describes both the catalog exposure gap and stream mapping concern.
Members:
fixed_by_candidate: fix(opencode-go): enable xhigh/max thinking levels for DeepSeek V4 #99618 - The PR body uses closing syntax for this issue and edits the opencode-go catalog and stream files for the reported behavior, but it remains open and conflicting.same_root_cause: bug(opencode-go): DeepSeek V4 models silently drop max/xhigh thinking level due to missing thinkingLevelMap #99601 - The earlier same-author issue describes the same opencode-go DeepSeek V4 xhigh/max thinkingLevelMap gap and payload result.partial_overlap: fix(opencode-go): add supportedReasoningEfforts to DeepSeek V4 model entries #80033 - The older draft/conflicting PR targets the same opencode-go DeepSeek V4 thinking-level exposure gap but uses a different profile-hook shape and is not a safe superseding landing path.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
No separate repair job should start while the issue is already paired with the open closing PR at #99618.
Review details
Best possible solution:
Land one focused opencode-go provider fix that exposes xhigh/max for DeepSeek V4, preserves the shared DeepSeek wrapper behavior, and includes focused tests plus real after-fix proof.
Do we have a high-confidence way to reproduce the issue?
Yes, by source inspection: current main lacks thinkingLevelMap for the two opencode-go DeepSeek V4 models, and getSupportedThinkingLevels hides xhigh/max when those entries are absent. I did not run a live opencode-go API request in this read-only review.
Is this the best way to solve the issue?
No, the issue is not solved yet. The best path is to review, repair, or replace the linked candidate PR so the provider catalog/profile and stream wrapper behavior agree without duplicating shared payload logic.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against df1452799b28.
Label changes
Label justifications:
P2: This is a bounded provider/model capability bug affecting opencode-go DeepSeek V4 thinking-level selection and payload behavior.impact:auth-provider: The issue concerns model/provider capability exposure and the reasoning payload sent through the provider runtime.Evidence reviewed
What I checked:
AGENTS.md:1, df1452799b28)extensions/AGENTS.md:1, df1452799b28)extensions/opencode-go/provider-catalog.ts:37, df1452799b28)src/llm/model-utils.ts:46, df1452799b28)src/plugin-sdk/provider-stream-shared.ts:481, df1452799b28)extensions/deepseek/thinking.ts:5, df1452799b28)Likely related people:
extensions/opencode-go/provider-catalog.ts,extensions/opencode-go/stream.ts)extensions/opencode-go/stream.ts,extensions/opencode-go/stream-termination.ts)src/plugin-sdk/provider-stream-shared.ts,extensions/opencode-go/provider-catalog.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.34262315716 commentedon Jul 4, 2026
A new PR has been submitted that replaces #99618 with a cleaner approach:
PR #99882 —
fix(opencode-go): register thinking profile to enable xhigh/max supportInstead of adding
thinkingLevelMapto model entries (which only affected stream wrapping, not the UI), this PR:resolveThinkingProfilehook (newthinking.ts), exposing the full off~max level rangereasoning_effortcorrectlyAPI verification has been done against the opencode-go endpoint confirming that
reasoning_effort: "max","high", and disabled thinking all work as expected.PR #99618 is superseded and will not be pursued further.
34262315716 commentedon Jul 4, 2026
Closing — PR #99643 by mushuiyu886 provides a complete fix for this issue with:
Our PR #99882 is withdrawn in favor of #99643.
34262315716 commentedon Jul 4, 2026
Closing — PR #99643 by mushuiyu886 provides a complete fix. Our PR #99882 is withdrawn in favor of #99643.
steipete commentedon Jul 29, 2026
Thank you for the detailed report and for confirming that #99643 resolves this. The fix is already merged into
mainas a97d97f.I verified both OpenCode Go DeepSeek V4 model entries, the cold-start thinking profile and manifest, and the real outgoing reasoning payload:
xhighandmaxare selectable and both sendreasoning_effort: "max"; existing lower levels and disabled thinking are preserved. The current regression suites pass all 36 focused tests, including both models and the Gateway provider-policy artifact.Closing as completed, as you requested. The broader OpenCode catalog-discovery follow-up in #113549 remains open.