Repository navigation
fix(opencode-go): register thinking profile to enable xhigh/max support - #99882
34262315716 wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 4, 2026, 4:21 AM ET / 08:21 UTC. Summary PR surface: Source +28. Total +28 across 2 files. Reproducibility: yes. Source inspection shows current main has the opencode-go DeepSeek V4 models and shared stream wrapper but no opencode-go provider thinking profile hook, so user-facing profile resolution falls back to the base level set. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical opencode-go DeepSeek V4 provider-profile fix, preferably the proof-positive sibling branch, while keeping the shared DeepSeek V4 wrapper as the wire-contract source. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main has the opencode-go DeepSeek V4 models and shared stream wrapper but no opencode-go provider thinking profile hook, so user-facing profile resolution falls back to the base level set. Is this the best way to solve the issue? No, not as the best landing path while the sibling remains viable. This PR uses the right hook shape, but #99643 covers the same root fix with stronger proof, tests, and metadata alignment. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 55d0d037bfde. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +28. Total +28 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Add resolveThinkingProfile hook for opencode-go DeepSeek V4 models, exposing the full thinking level range (off~max). The stream wrapper already handles reasoning_effort mapping correctly via the shared createDeepSeekV4OpenAICompatibleThinkingWrapper; this change only fixes the UI/gateway display so xhigh and max become selectable. API verification results (against opencode.ai/zen/go/v1): - reasoning_effort: max -> 200 + reasoning_content (134 tokens) - reasoning_effort: high -> 200 + reasoning_content (119 tokens) - thinking: disabled -> 200 + direct answer (no reasoning)
0be88f6 to
30829ec
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Withdrawn — PR #99643 by mushuiyu886 provides a more complete fix with thinkingLevelMap, manifest metadata, tests, and real behavior proof. |
Summary
Fixes: #99617
Problem
Opencode-go DeepSeek V4 models (
deepseek-v4-pro,deepseek-v4-flash) havesupportsReasoningEffort: truebut lack aresolveThinkingProfilehook. Without one, the gateway falls back to the base thinking profile (off~high), soxhighandmaxnever appear in the UI even though the stream wrapper (createDeepSeekV4OpenAICompatibleThinkingWrapper) already handles them correctly on the wire.PR #99618 attempted to fix this by adding
thinkingLevelMapto the model entries, but that approach has two problems:thinkingLevelMaponly affects the stream wrapper — it does not influenceresolveThinkingProfile(), so the UI/gateway still filters out xhigh/max.high → "max", silently changing existing/think highbehavior fromreasoning_effort: "high"to"max", which affects cost and latency.Changes
extensions/opencode-go/thinking.ts(new) — Define a thinking profile identical to the deepseek extensions pattern, exposing the full level range:off, minimal, low, medium, high, xhigh, maxwithdefaultLevel: "high".extensions/opencode-go/index.ts(+3 lines) — RegisterresolveThinkingProfilehook pointing at the new profile.stream.ts/provider-catalog.ts— Unchanged. The sharedcreateDeepSeekV4OpenAICompatibleThinkingWrapperalready maps thinking levels to reasoning_effort correctly.Real API Verification
All three tests conducted against
https://opencode.ai/zen/go/v1withdeepseek-v4-pro:Test 1: reasoning_effort: "max"
Result: HTTP 200 ✅ — Response contains
reasoning_content(134 reasoning tokens), full chain-of-thought reasoning in Chinese.Test 2: reasoning_effort: "high"
Result: HTTP 200 ✅ — Contains
reasoning_content(119 reasoning tokens), shorter than "max" as expected.Test 3: thinking disabled
Result: HTTP 200 ✅ — No
reasoning_content, direct 6-token answer, reasoning fully disabled.Verification
npx tsc -p extensions/opencode-go/tsconfig.json --noEmit