Skip to content

fix(opencode-go): expose DeepSeek V4 max thinking levels - #99643

Merged
steipete merged 1 commit into
openclaw:mainfrom
mushuiyu886:feat/issue-99601
Jul 21, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
mushuiyu886:feat/issue-99601

Conversation

@mushuiyu886

@mushuiyu886 mushuiyu886 commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #99601.

OpenCode Go's deepseek-v4-pro and deepseek-v4-flash accept provider effort max, but their OpenClaw catalog rows did not advertise xhigh or max. /think max was therefore clamped to high before the request reached the provider. The plugin also activates on demand, so cold /think and Gateway projection paths need the same provider-owned profile before runtime registration.

Why This Change Was Made

  • Adds the DeepSeek V4 thinking map to both OpenCode Go catalog sources.
  • Adds a lightweight provider-policy artifact and reuses its model-family predicate from runtime registration and stream wrapping.
  • Preserves shipped lower-level behavior: minimal, low, medium, and high continue to send provider effort high; only xhigh and max send provider effort max.
  • Keeps off on the existing DeepSeek-specific disabled-thinking payload path.

This is intentionally narrower than changing lower-level quality, latency, or cost behavior.

User Impact

OpenCode Go DeepSeek V4 users can select xhigh and max without silent downgrade. Cold Gateway/model-control projections expose the complete OpenClaw level set before the runtime plugin activates. Other OpenCode Go models are unchanged.

Evidence

Exact head: 34391f75de7934e9600531d4a02f303f09aa93f8

  • node scripts/run-vitest.mjs extensions/opencode-go/index.test.ts src/plugins/provider-public-artifacts.test.ts — 35 tests passed.
  • Gateway pre-activation projection for opencode-go/deepseek-v4-pro returned thinkingDefault: max and levels off, minimal, low, medium, high, xhigh, max before runtime registration.
  • Live OpenCode Go deepseek-v4-flash requests returned HTTP 200 with reasoning output for provider efforts high, max, low, and medium. The branch deliberately retains lower OpenClaw levels at provider high to avoid a separate compatibility change.
  • Blacksmith Testbox changed-file gate passed on the patch-identical pre-rebase tree: https://github.com/openclaw/openclaw/actions/runs/29811726070
  • Final AutoReview reported no accepted/actionable findings.

Compatibility / Decision

This adds provider capability and pre-activation policy surface, so it requires maintainer product/provider acceptance before merge. No config key, dependency, protocol, credential handling, or generic thinking policy changes.

Co-authored-by: 杨浩宇0668001029 [email protected]

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 2:09 AM ET / 06:09 UTC.

Summary
The PR adds DeepSeek V4 thinking-level maps and a lightweight OpenCode Go provider policy artifact so runtime and pre-activation validation expose and preserve off through max reasoning levels.

PR surface: Source +74, Tests +157. Total +231 across 7 files.

Reproducibility: yes. from source, though not by a fresh local run: current main lacks the profile/map needed for xhigh and max validation, and the earlier transport proof separately demonstrated the clamping and payload behavior.

Review metrics: 1 noteworthy metric.

  • Thinking policy surfaces: 2 model maps changed, 1 pre-runtime profile added. These surfaces jointly determine which levels users can select and which reasoning effort reaches the provider.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99601
Summary: The current PR is the strongest viable candidate for the canonical bug; related issues describe the same missing capability, while competing PRs are draft, conflicted, closed, or less complete.

Members:

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

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add a redacted current-head /think or Gateway pre-activation transcript and representative outbound payload capture.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: Earlier proof convincingly covers max/xhigh transport behavior, but the rebuilt head's new cold pre-activation policy path is demonstrated only by tests rather than a current-head real /think or Gateway run; post redacted evidence and update the PR body to trigger review, or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] The rebuilt head does not include a direct current-head transcript or payload capture proving that cold /think or Gateway validation resolves the profile before OpenCode Go runtime activation.
  • [P1] The new low and medium catalog mappings change effective provider effort for users whose selections were previously promoted to high, which can alter output, latency, and cost even though the change appears intentional.

Maintainer options:

  1. Prove the rebuilt head before merge (recommended)
    Capture a redacted current-head run showing pre-activation /think or Gateway validation plus outbound effort values for representative off, low, medium, and max selections.
  2. Accept equivalent prior proof
    A maintainer may accept the prior transport proof and exact-head CI if they confirm the rebuild is behaviorally equivalent and the new cold-path test is sufficient for the added artifact wiring.

Next step before merge

  • [P1] No mechanical code repair is identified; a human should confirm current-head real behavior proof and intentionally accept the provider mapping compatibility change before merge.

Security
Cleared: The diff adds no dependency, workflow, credential, permission, download, or new third-party execution surface, and the provider artifact remains a narrow typed policy module.

Review details

Best possible solution:

Land one canonical provider-owned implementation after confirming on the current head that cold control-plane selection exposes all levels and that off, low, medium, high, xhigh, and max produce the intended OpenCode Go request payloads; then resolve the paired issues and retire the weaker overlapping PRs.

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

Yes from source, though not by a fresh local run: current main lacks the profile/map needed for xhigh and max validation, and the earlier transport proof separately demonstrated the clamping and payload behavior.

Is this the best way to solve the issue?

Yes. A narrow provider-owned policy artifact shared with runtime registration is more maintainable than core tables or eager plugin activation, and this branch also preserves the existing shared stream wrapper rather than duplicating transport logic.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5f2828b50ada.

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦞 diamond lobster.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded provider bug that silently changes requested reasoning intensity for two models without affecting the core runtime broadly.
  • merge-risk: 🚨 compatibility: The branch changes effective low and medium reasoning mappings for existing OpenCode Go DeepSeek V4 users.
  • merge-risk: 🚨 auth-provider: The branch changes provider-owned model capability resolution and request effort routing across runtime and cold validation paths.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Needs stronger real behavior proof before merge: Earlier proof convincingly covers max/xhigh transport behavior, but the rebuilt head's new cold pre-activation policy path is demonstrated only by tests rather than a current-head real /think or Gateway run; post redacted evidence and update the PR body to trigger review, or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +74, Tests +157. Total +231 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 5 78 4 +74
Tests 2 176 19 +157
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 254 23 +231

What I checked:

  • Current-main gap: The PR diff against current main shows that both OpenCode Go DeepSeek V4 catalog rows still need explicit thinkingLevelMap metadata and that OpenCode Go lacks a provider-owned profile available before runtime activation. (extensions/opencode-go/provider-catalog.ts:40, 5f2828b50ada)
  • Owner-boundary fit: The new lightweight provider-policy artifact keeps vendor-specific model policy inside the owning plugin while allowing manifest-first control-plane resolution, matching the scoped extension and plugin-loader guidance. (extensions/opencode-go/provider-policy-api.ts:1, bc3a64e89243)
  • Runtime alignment: The runtime provider registration reuses the same resolveThinkingProfile export, while the stream wrapper reuses the shared DeepSeek V4 model-family predicate instead of maintaining a second matcher. (extensions/opencode-go/index.ts:137, bc3a64e89243)
  • Cold-path regression coverage: The added core test verifies that the bundled public-artifact loader can resolve the OpenCode Go DeepSeek V4 profile before runtime registration and does not apply it to unrelated models. (src/plugins/provider-public-artifacts.test.ts:125, bc3a64e89243)
  • Exact-head automated validation: The provided GitHub context reports the current head as mergeable with the main CI gate, provider runtime boundary, type, lint, security, build-artifact, and real-behavior-proof checks successful. (bc3a64e89243)
  • Earlier transport proof: The closed overlapping PR demonstrated redacted loopback transport payloads where xhigh/max reached both DeepSeek V4 models as reasoning_effort=max, while explicitly documenting that cold command/profile validation remained missing; this PR addresses that remaining path. (extensions/opencode-go/stream.ts:12, eb996427e1c1)

Likely related people:

  • steipete: Repository discussion attributes the OpenCode Go DeepSeek V4 supplemental catalog and its ownership in provider-catalog.ts to commit 390be81. (role: introduced behavior; confidence: high; commits: 390be81; files: extensions/opencode-go/provider-catalog.ts, extensions/opencode-go/index.ts)
  • amknight: Recent merged work associated with the provider-aware /think selector and active-model profile resolution makes this person relevant to the control-plane validation behavior. (role: adjacent owner; confidence: medium; files: src/plugins/provider-thinking.ts, src/plugins/provider-runtime.ts)
  • aaajiao: Recent OpenCode provider work used the lightweight provider-policy surface to expose provider-specific thinking profiles before broad runtime activation, closely matching this branch's architectural path. (role: recent area contributor; confidence: medium; files: src/plugins/provider-public-artifacts.ts, extensions/opencode/provider-policy-api.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (2 earlier review cycles)
  • reviewed 2026-07-04T03:04:22.076Z sha 4b13e5e2a42392183875d0b15ebbc28f260e76dd :: needs maintainer review before merge. :: none
  • reviewed 2026-07-16T05:28:09.192Z sha bc3a64e89243ecb819e0437063168768ea821033 :: needs maintainer review before merge. :: none

@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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. labels Jul 3, 2026
@mushuiyu886 mushuiyu886 changed the title fix #99601: fix(opencode-go): expose DeepSeek V4 max thinking levels fix(opencode-go): expose DeepSeek V4 max thinking levels Jul 4, 2026
@steipete steipete self-assigned this Jul 21, 2026
Preserve existing lower-level high effort while making xhigh/max available before runtime activation.

Co-authored-by: 杨浩宇0668001029 <[email protected]>
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(opencode-go): expose DeepSeek V4 max thinking levels This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit a97d97f into openclaw:main Jul 21, 2026
122 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 22, 2026
Preserve existing lower-level high effort while making xhigh/max available before runtime activation.

Co-authored-by: Peter Steinberger <[email protected]>
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

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

2 participants