Skip to content

fix(opencode-go): add supportedReasoningEfforts to DeepSeek V4 model entries - #80033

Closed
wrcno1 wants to merge 1 commit into
openclaw:mainfrom
wrcno1:fix/opencode-go-xhigh-thinking
Closed

wrcno1 wants to merge 1 commit into
openclaw:mainfrom
wrcno1:fix/opencode-go-xhigh-thinking

Conversation

@wrcno1

@wrcno1 wrcno1 commented May 10, 2026 •

Copy link
Copy Markdown

Problem

DeepSeek V4 Flash and V4 Pro natively support reasoning_effort: "max" at the API level. OpenClaw's stream layer already maps xhigh/max to "max" on the wire via resolveDeepSeekV4ReasoningEffort(). However, the opencode-go provider did not expose these levels through the thinking validation layer, causing /think xhigh and /think max to be rejected.

Solution

Follow the same pattern used by the OpenRouter extension: add supportsXHighThinking and resolveThinkingProfile hooks to the opencode-go provider registration, declaring a thinking profile that includes xhigh and max for DeepSeek V4 models.

Changes

  • extensions/opencode-go/thinking-policy.ts (new) — Thinking level definitions for DeepSeek V4 models (off through max).
  • extensions/opencode-go/index.ts — Added supportsXHighThinking and resolveThinkingProfile hooks.

Real behavior proof

behavior

Thinking level "max" was previously rejected for opencode-go/deepseek-v4-flash with the error "Thinking level "max" is not supported". After the fix, setting thinkingDefault: "max" is accepted and the session activates with Think: max without errors.

environment

  • OpenClaw v2026.5.7 (eeef486)
  • Provider: opencode-go
  • Model: deepseek-v4-flash
  • OS: Ubuntu 24.04 LTS (Linux 6.8.0-111-generic x64)
  • Running as systemd user service on a KVM VPS

steps

  1. Applied the equivalent patch to the compiled extension JS at dist/extensions/opencode-go/index.js, adding supportsXHighThinking and resolveThinkingProfile hooks matching the source change in this PR.
  2. Set thinkingDefault: "max" in openclaw.json.
  3. Restarted the OpenClaw gateway.
  4. Verified session status shows Think: max active.
  5. Verified no "not supported" errors from the thinking validation layer.

evidence

Session status output:

Model: opencode-go/deepseek-v4-flash
Think: max

Config:

"thinkingDefault": "max"

observedResult

Think: max is accepted and active. The session applies thinking level "max" and the stream wrapper sends reasoning_effort: "max" on the wire for all API requests.

notTested

Stream-level reasoning_effort payload was verified via code inspection of resolveDeepSeekV4ReasoningEffort() which maps both xhigh and max to the string "max". Actual wire capture was not performed.

Related: #76482

Copilot AI review requested due to automatic review settings May 10, 2026 00:48
@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 10, 2026
@clawsweeper

clawsweeper Bot commented May 10, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and the useful part of this older PR is already implemented there.

Close this 83-day-old draft PR: current main now provides the same DeepSeek V4 xhigh/max capability through a broader provider-owned catalog and public policy artifact, so the branch’s runtime-only hooks have no meaningful unique remainder.

So I’m closing this older PR as already covered on main rather than keeping a mostly-duplicated branch open.

Review details

Best possible solution:

Keep the current provider-owned catalog and public policy implementation, which exposes the levels before runtime activation and preserves the intended DeepSeek effort mapping.

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

Yes, source-reproducible: current provider tests assert that both OpenCode Go DeepSeek V4 models retain xhigh and max and resolve the complete thinking profile.

Is this the best way to solve the issue?

Yes: the current catalog plus public provider-policy artifact is better than this branch’s runtime-only hook because it also covers capability resolution before the plugin runtime activates.

Security review:

Security review cleared: The PR changes provider capability declarations only and introduces no concrete security or supply-chain concern.

AGENTS.md: found and applied where relevant.

What I checked:

  • Current catalog exposes both higher levels: Current main declares a shared DeepSeek V4 thinking-level map for both Flash and Pro, preserving lower levels at provider effort high and mapping xhigh and max to provider effort max. (extensions/opencode-go/provider-catalog.ts:28, 71a59512ba47)
  • Current policy covers validation before runtime activation: The current public provider-policy artifact returns the complete seven-level thinking profile for OpenCode Go DeepSeek V4 models, which is broader than the PR’s runtime registration hook because it also supports pre-activation policy resolution. (extensions/opencode-go/provider-policy-api.ts:7, 71a59512ba47)
  • Current regression coverage verifies selectable levels: The OpenCode Go provider test asserts that both DeepSeek V4 models retain xhigh and max through thinking-level clamping and resolve to the complete thinking profile. (extensions/opencode-go/index.test.ts:68, 71a59512ba47)
  • Merged replacement provenance: The merged replacement PR implemented the provider-owned catalog, manifest, policy-artifact, stream, and regression-test path that supersedes this branch’s two-file runtime-hook approach. (extensions/opencode-go/provider-policy-api.ts:1, a97d97f95bd9)
  • Current-main and release provenance: Blame attributes the current provider-policy implementation to the current-main proof commit on August 1, 2026. The latest identified release, v2026.7.1, was tagged July 13, 2026, before the July 21 merged replacement; neither the replacement nor the current proof commit is contained by a local release tag, so this is current-main-only evidence. (extensions/opencode-go/provider-policy-api.ts:7, b5f1bdb88600)

Likely related people:

  • mushuiyu886: Authored the merged provider-owned replacement that covered the same DeepSeek V4 capability across catalog, policy, stream, and tests. (role: introduced merged replacement; confidence: high; commits: a97d97f95bd9; files: extensions/opencode-go/provider-catalog.ts, extensions/opencode-go/provider-policy-api.ts, extensions/opencode-go/stream.ts)
  • Peter Steinberger: Current-main blame attributes the policy artifact and current catalog implementation to this later plugin-area revision. (role: recent area contributor; confidence: medium; commits: b5f1bdb88600; files: extensions/opencode-go/provider-catalog.ts, extensions/opencode-go/provider-policy-api.ts, extensions/opencode-go/index.ts)

Codex review notes: model internal, reasoning high; reviewed against 71a59512ba47; fix evidence: commit b5f1bdb88600, main fix timestamp 2026-08-01T01:56:44-07:00.

Copilot AI 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.

Pull request overview

Adds missing supportedReasoningEfforts compat metadata for the opencode-go provider’s DeepSeek V4 model entries so OpenClaw can validate and surface higher thinking/reasoning levels (notably xhigh/max) instead of rejecting them.

Changes:

  • Add supportedReasoningEfforts to deepseek-v4-pro compat metadata.
  • Add supportedReasoningEfforts to deepseek-v4-flash compat metadata.

Comment on lines +36 to +40
"medium",
"high",
"xhigh",
"max",
],
Comment on lines +63 to +71
supportedReasoningEfforts: [
"off",
"minimal",
"low",
"medium",
"high",
"xhigh",
"max",
],
…dels via provider hooks

DeepSeek V4 Flash and V4 Pro natively support reasoning_effort: "max",
and OpenClaw's stream layer already maps xhigh/max to "max" on the wire.
However, the opencode-go provider did not expose these levels through
the thinking validation layer, causing "/think xhigh" and "/think max"
to be rejected.

Follow the same pattern used by the OpenRouter extension:
add supportsXHighThinking and resolveThinkingProfile hooks to the
opencode-go provider registration, declaring a thinking profile
that includes xhigh and max for the deepseek-v4-flash and
deepseek-v4-pro models.
@wrcno1
wrcno1 force-pushed the fix/opencode-go-xhigh-thinking branch from 05c9241 to a13a6ee Compare May 10, 2026 00:57
@wrcno1
wrcno1 marked this pull request as draft May 10, 2026 01:06
@wrcno1
wrcno1 marked this pull request as ready for review May 10, 2026 01:09
@wrcno1
wrcno1 marked this pull request as draft May 10, 2026 01:14
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 14, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 14, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. P2 Normal backlog priority with limited blast radius. labels May 16, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 17, 2026
@openclaw-barnacle

Copy link
Copy Markdown

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

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. stale Marked as stale due to inactivity labels Jun 1, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 2, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 2, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 18, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 19, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 23, 2026
@openclaw-barnacle

Copy link
Copy Markdown

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

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 27, 2026
@clawsweeper clawsweeper Bot removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for working on this! The same fix has already landed in #99643 (a97d97f), with broader coverage: both DeepSeek V4 Flash and Pro expose the complete thinking profile before plugin activation, preserve xhigh/max in manifest and runtime catalogs, and translate both levels into the supported max reasoning effort on the provider wire. Ten focused current-main tests covering those paths pass. The supported models and effort contract are also documented at https://opencode.ai/docs/go/ and https://api-docs.deepseek.com/guides/thinking_mode/. Closing this draft as fully superseded; thanks again for the contribution.

@steipete steipete closed this Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS stale Marked as stale due to inactivity triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants