Skip to content

fix: preserve OpenCode Go DeepSeek V4 max thinking - #99637

Closed
MonkeyLeeT wants to merge 1 commit into
openclaw:mainfrom
MonkeyLeeT:codex/99601-opencode-go-thinking-map
Closed

MonkeyLeeT wants to merge 1 commit into
openclaw:mainfrom
MonkeyLeeT:codex/99601-opencode-go-thinking-map

Conversation

@MonkeyLeeT

@MonkeyLeeT MonkeyLeeT commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #99601

AI-assisted: yes (Codex).

What Problem This Solves

Fixes an issue where users selecting /think max or /think xhigh with opencode-go/deepseek-v4-pro or opencode-go/deepseek-v4-flash would have the requested thinking level silently clamped down before the OpenCode Go DeepSeek V4 request was built.

Why This Change Was Made

The OpenCode Go DeepSeek V4 model rows now carry an explicit thinking-level map in both runtime catalog data and manifest metadata: off disables thinking, normal levels map to DeepSeek's low/medium/high efforts, and xhigh/max map to DeepSeek's max effort. The fix stays inside the opencode-go provider metadata so the existing generic clamp and DeepSeek V4 OpenAI-compatible stream wrapper continue to own their current behavior.

User Impact

OpenCode Go DeepSeek V4 users can use max/xhigh thinking and have the request reach the provider as max effort instead of being downgraded to high. Static model discovery and runtime provider discovery now agree on the same DeepSeek V4 thinking capabilities.

Evidence

Redacted after-fix OpenCode Go payload proof at eb996427e1c127760a99a3960b1ea87bc90a794a:

probe: opencode-go DeepSeek V4 thinking metadata + payload capture
models checked: opencode-go/deepseek-v4-pro, opencode-go/deepseek-v4-flash
network/API key use: none; local provider wrapper payload capture only

opencode-go/deepseek-v4-pro:
  thinkingLevelMap.xhigh = max
  thinkingLevelMap.max = max
  clampThinkingLevel(max) = max
  clampThinkingLevel(xhigh) = xhigh
  captured payload thinking = { type: enabled }
  captured payload reasoning_effort = max

opencode-go/deepseek-v4-flash:
  thinkingLevelMap.xhigh = max
  thinkingLevelMap.max = max
  clampThinkingLevel(max) = max
  clampThinkingLevel(xhigh) = xhigh
  captured payload thinking = { type: enabled }
  captured payload reasoning_effort = max

Stronger real-transport proof from the same checkout:

probe: opencode-go real OpenAI-compatible transport through loopback SSE capture
entrypoints: registered OpenCode Go plugin -> provider.wrapStreamFn -> streamSimpleOpenAICompletions -> guarded OpenAI SDK HTTP transport
network/API key use: no external network; dummy API key redacted; local HTTP SSE endpoint captured outbound request bodies
models checked: opencode-go/deepseek-v4-pro, opencode-go/deepseek-v4-flash, opencode-go/glm-5

opencode-go/deepseek-v4-pro:
  POST /v1/chat/completions
  Authorization: present:redacted
  request.model = deepseek-v4-pro
  request.stream = true
  request.thinking = { type: enabled }
  request.reasoning_effort = max
  request.max_tokens = 8
  request.stream_options.include_usage = true
  final stream stopReason = stop
  final stream text = ok

opencode-go/deepseek-v4-flash:
  POST /v1/chat/completions
  Authorization: present:redacted
  request.model = deepseek-v4-flash
  request.stream = true
  request.thinking = { type: enabled }
  request.reasoning_effort = max
  request.max_tokens = 8
  request.stream_options.include_usage = true
  final stream stopReason = stop
  final stream text = ok

unrelated control, opencode-go/glm-5:
  POST /v1/chat/completions
  request.model = glm-5
  request.stream = true
  request.reasoning_effort = high
  request.max_completion_tokens = 8
  no DeepSeek V4 thinking object was added
  final stream stopReason = stop
  final stream text = ok

Known remaining validation-path proof from the same probes:

opencode-go/deepseek-v4-pro command/profile levels: off, minimal, low, medium, high
opencode-go/deepseek-v4-pro commandSupportsXHigh = false
opencode-go/deepseek-v4-pro commandSupportsMax = false

opencode-go/deepseek-v4-flash command/profile levels: off, minimal, low, medium, high
opencode-go/deepseek-v4-flash commandSupportsXHigh = false
opencode-go/deepseek-v4-flash commandSupportsMax = false

That remaining validation-path result matches ClawSweeper's current code-path finding and is not claimed fixed by this proof-only evidence update.

Remote proof note: Testbox-through-Crabbox was attempted, but this operator environment does not have the blacksmith CLI installed. Brokered Crabbox also reports missing coordinator auth, so there is no remote tbx_... or cbx_... id for this proof run.

Autoreview was started, then interrupted at maintainer request to avoid blocking this draft PR; no autoreview verdict is included.

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: the useful intent is covered by the open, mergeable, proof-positive replacement at #99643, while this draft still carries the off: null and validation-path defects identified in review.

Root-cause cluster
Relationship: superseded
Canonical: #99643
Summary: This draft is superseded by a stronger open replacement PR for the same OpenCode Go DeepSeek V4 thinking-level bug.

Members:

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

Canonical path: Keep the provider-profile replacement as the canonical path, then close duplicate issue/PR siblings after one fixed branch lands.

So I’m closing this here and keeping the remaining discussion on #99643.

Review details

Best possible solution:

Keep the provider-profile replacement as the canonical path, then close duplicate issue/PR siblings after one fixed branch lands.

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

Yes. Source inspection shows this branch only updates model maps while /think and Gateway validation read provider thinking profiles, and the PR body's own proof still reports xhigh and max unsupported in the command/profile path.

Is this the best way to solve the issue?

No. This is a partial lower-level map fix; the better owner-boundary solution is the provider-profile approach in #99643, which also avoids the invalid off: null state.

Security review:

Security review cleared: No concrete security or supply-chain concern is visible; the diff changes provider metadata and tests without touching dependencies, workflows, permissions, secrets, downloads, or install scripts.

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read: Read the full root AGENTS.md and scoped extensions guide; their plugin-boundary, best-fix, proof, and merge-risk guidance applies to this provider PR. (AGENTS.md:1, 87d88878787b)
  • Current main lacks the requested OpenCode Go map/profile: Current main defines the two OpenCode Go DeepSeek V4 models as reasoning-capable with supportsReasoningEffort, but without thinkingLevelMap or a provider thinking profile. (extensions/opencode-go/provider-catalog.ts:37, 87d88878787b)
  • Model map contract makes off: null unsupported: getSupportedThinkingLevels() filters out any level whose map value is null, so this PR's off: null removes explicit disabled thinking from model-backed options. (src/llm/model-utils.ts:46, 87d88878787b)
  • User-facing validation does not read thinkingLevelMap: resolveThinkingProfile() builds /think and Gateway thinking levels from provider profiles or compat fields; ThinkingCatalogEntry does not carry thinkingLevelMap. (src/auto-reply/thinking.ts:181, 87d88878787b)
  • PR diff leaves the validation path incomplete: The PR adds xhigh and max to model maps but not the OpenCode Go provider thinking profile; its own PR body proof records commandSupportsXHigh = false and commandSupportsMax = false. (extensions/opencode-go/provider-catalog.ts:50, eb996427e1c1)
  • Replacement PR is the safer canonical path: fix(opencode-go): expose DeepSeek V4 max thinking levels #99643 is open, not draft, mergeable, labeled proof sufficient, and adds the provider-owned resolveThinkingProfile hook plus tests and real-behavior proof for /think, Gateway PATCH/rows, and outbound payload capture. (extensions/opencode-go/index.ts:137, 043440fa98dd)

Likely related people:

  • steipete: Added the OpenCode Go DeepSeek V4 model rows that this PR modifies and has adjacent provider/plugin SDK history around thinking and stream seams. (role: feature-history owner; confidence: high; commits: 390be8138f28; files: extensions/opencode-go/provider-catalog.ts, extensions/opencode-go/stream.ts)
  • ImLukeF: Authored the merged OpenCode Go provider support PR that introduced the provider/model routing surface later used by this bug. (role: introduced provider surface; confidence: medium; commits: 7761e7626ffe; files: extensions/opencode-go/provider-catalog.ts, extensions/opencode-go/index.ts, extensions/opencode-go/openclaw.plugin.json)
  • vincentkoc: Recent history carries OpenCode Go catalog/auth helper and release-state touches near the affected provider files and shared stream helper surface. (role: recent adjacent contributor; confidence: medium; commits: 66701d5a1e16, e085fa1a3ffd; files: extensions/opencode-go/index.ts, extensions/opencode-go/provider-catalog.ts, src/plugin-sdk/provider-stream-shared.ts)
  • zhangguiping-xydt: Authored recent merged OpenCode Go stream-wrapper work around the same createOpencodeGoWrapper path that must remain compatible with this thinking change. (role: recent stream-wrapper contributor; confidence: medium; commits: 769579bcf0c2; files: extensions/opencode-go/stream.ts, extensions/opencode-go/stream-termination.ts)
  • ai-hpc: Authored the direct DeepSeek V4 max thinking-level profile fix, the closest sibling pattern for exposing off, xhigh, and max through provider validation. (role: adjacent thinking-profile contributor; confidence: medium; commits: 007023e8a4bd; files: extensions/deepseek/index.ts, extensions/deepseek/models.ts, extensions/deepseek/thinking.ts)

Codex review notes: model internal, reasoning high; reviewed against 87d88878787b.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 3, 2026
@MonkeyLeeT
MonkeyLeeT marked this pull request as ready for review July 3, 2026 19:52
@MonkeyLeeT
MonkeyLeeT marked this pull request as draft July 3, 2026 19:53

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Proof-only update: the PR body now includes redacted after-fix OpenCode Go payload proof and explicitly records the remaining command/profile validation proof result.

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb996427e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jul 3, 2026
@MonkeyLeeT

Copy link
Copy Markdown
Contributor Author

Closing this draft as superseded by #99643, which is the canonical replacement for the #99601 OpenCode Go DeepSeek V4 thinking-level fix. This draft still has the off-map and validation-path issues ClawSweeper called out, so keeping review and proof on #99643.

@MonkeyLeeT MonkeyLeeT closed this Jul 4, 2026
@MonkeyLeeT
MonkeyLeeT deleted the codex/99601-opencode-go-thinking-map branch July 4, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: opencode-go merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant