Skip to content

fix(openrouter): keep DeepSeek V4 reasoning effort valid - #77423

Merged
clawsweeper[bot] merged 3 commits into
openclaw:mainfrom
sallyom:issue-77350
May 4, 2026
Merged

clawsweeper[bot] merged 3 commits into
openclaw:mainfrom
sallyom:issue-77350

Conversation

@sallyom

@sallyom sallyom commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove max from OpenRouter DeepSeek V4 thinking profiles so menus and config validation advertise only OpenRouter-supported values
  • map stale OpenRouter DeepSeek V4 max thinking overrides to reasoning_effort: "xhigh" instead of sending OpenRouter-invalid max
  • keep direct DeepSeek V4 behavior unchanged, where xhigh|max still maps to native DeepSeek reasoning_effort: "max"

Fixes #77350.

Verification

  • pnpm test extensions/openrouter/index.test.ts src/plugin-sdk/provider-stream.test.ts src/plugin-sdk/provider-stream-shared.test.ts extensions/deepseek/index.test.ts
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/providers/openrouter.md docs/tools/thinking.md extensions/openrouter/index.test.ts extensions/openrouter/stream.ts extensions/openrouter/thinking-policy.ts src/plugin-sdk/provider-stream-shared.ts
  • pnpm exec oxlint extensions/openrouter/index.test.ts extensions/openrouter/stream.ts extensions/openrouter/thinking-policy.ts src/plugin-sdk/provider-stream-shared.ts
  • pnpm lint:extensions
  • Blacksmith Testbox isolated pnpm lint:extensions reproduced and then verified the lint fix path
  • Live container image built from this branch and tested against a running OpenClaw configured with OpenRouter DeepSeek; confirmed the reported DeepSeek V4 Pro request succeeds instead of failing with OpenRouter's invalid reasoning_effort 400

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S maintainer Maintainer-authored PR labels May 4, 2026
@clawsweeper

clawsweeper Bot commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

Summary
The PR removes max from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter max overrides to xhigh, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.

Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises max and sends reasoning_effort: "max", matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Next step before merge
No repair PR is needed from this pass; the next action is for ClawSweeper's current exact-head review result to replace the stale fix-required marker.

Security
Cleared: The diff changes provider payload mapping, docs, changelog, and tests only; it adds no dependencies, workflows, permissions, downloads, or secret-handling paths.

Review details

Best possible solution:

Let a fresh exact-head ClawSweeper review supersede the stale fix-required marker, then continue the existing automerge flow if checks and mergeability remain green.

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

Yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises max and sends reasoning_effort: "max", matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Is this the best way to solve the issue?

Yes. The PR keeps the fix provider-local, preserves direct DeepSeek V4 max behavior, and adds focused docs/tests; the remaining block is stale ClawSweeper review state rather than a better code path.

What I checked:

  • Current main advertises unsupported level: Current main still includes max in the OpenRouter DeepSeek V4 thinking profile, matching the linked regression report's unsupported menu/config surface. (extensions/openrouter/thinking-policy.ts:4, a71f90683766)
  • Current main sends bad wire value: The shared DeepSeek V4 wrapper maps xhigh and max to outbound reasoning_effort: "max"; OpenRouter wraps verified DeepSeek V4 routes through that helper on main. (src/plugin-sdk/provider-stream-shared.ts:253, a71f90683766)
  • PR fixes provider behavior: The PR head removes max from the OpenRouter profile and adds an OpenRouter-local resolver that maps stale max to xhigh while leaving direct DeepSeek behavior unchanged. (extensions/openrouter/stream.ts:57, becdea4223be)
  • Exact-head checks are green enough for this question: The exact head is becdea4223be; GitHub's check-runs for that SHA show check success and Critical Quality (plugin-sdk-package-contract) success, consistent with the maintainer's report that the baseline/package-contract checks are green. (becdea4223be)
  • Automerge is reading stale ClawSweeper state: The existing ClawSweeper review comment was updated for becdea4223be and still contains clawsweeper-verdict:needs-changes plus clawsweeper-action:fix-required ... finding=review-feedback, so the automerge loop can remain blocked even after unrelated CI checks pass. (becdea4223be)
  • Prior baseline concern was plausible but now needs superseding: openclaw/plugin-sdk/provider-stream-shared is a package export and the API baseline check compares generated hashes, which explains why the earlier review flagged it; the current issue is that the old structured finding has not been replaced by a clean exact-head ClawSweeper result. (package.json:1133, a71f90683766)

Likely related people:

  • vincentkoc: Issue and prior review context identify the OpenRouter DeepSeek V4 xhigh thinking profile and related stream/test surface as dating to 63ebe372e8fb, which is the current-main behavior this PR corrects. (role: introduced related behavior; confidence: high; commits: 63ebe372e8fb; files: extensions/openrouter/thinking-policy.ts, extensions/openrouter/stream.ts, extensions/openrouter/index.test.ts)
  • steipete: Prior review context links recent OpenRouter DeepSeek V4 replay and nearby provider-stream work to this maintainer, making them a likely routing candidate for provider/reasoning behavior. (role: recent maintainer / adjacent owner; confidence: medium; commits: e0221d37e504, d7b61228e2cb, 6fd1725a0636; files: extensions/openrouter/stream.ts, docs/providers/openrouter.md, src/plugin-sdk/provider-stream-shared.ts)
  • Ayaan Zaidi: Prior review context connects this person to recent Plugin SDK API baseline guardrail maintenance, which is the stale ClawSweeper blocker being discussed. (role: adjacent API guardrail maintainer; confidence: low; commits: b31cd35b3648; files: docs/.generated/plugin-sdk-api-baseline.sha256, scripts/generate-plugin-sdk-api-baseline.ts, src/plugin-sdk/api-baseline.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against a71f90683766.

@sallyom sallyom added the clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge label May 4, 2026
@sallyom

sallyom commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper rebase

Scope: resolve the CHANGELOG.md conflict on #77423 only. Leave the provider, docs, and tests unchanged unless the rebase itself requires a tiny adjustment; report unrelated findings separately.

@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🦞🔧
ClawSweeper picked this up.

Command: rebase
Action: repair worker queued. Run: https://github.com/openclaw/clawsweeper/actions/runs/25333286883
Model: gpt-5.5

I will keep the change narrow and update the PR branch if the repair worker finds a safe fix.

@sallyom

sallyom commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper stop

Taking the changelog conflict rebase locally now.

@clawsweeper clawsweeper Bot added clawsweeper:human-review Needs maintainer review before ClawSweeper can continue and removed clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge labels May 4, 2026
@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🦞✅
Got it. ClawSweeper will leave this item for human review.

I added clawsweeper:human-review, removed clawsweeper:autofix, and paused the automation trail until a maintainer asks again.

@sallyom
sallyom force-pushed the issue-77350 branch 3 times, most recently from d6a3f01 to ecfa9d2 Compare May 4, 2026 18:28
@sallyom sallyom removed the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label May 4, 2026
@sallyom

sallyom commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 4, 2026
@clawsweeper

clawsweeper Bot commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=becdea4223be0cbb6806d92d11ca4307d19bfc3f)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-05-04T21:05:06Z
Merge commit: 02ac7dc5a62e

What merged:

  • The PR removes max from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter max overrides to xhigh, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
  • Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises max and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:

  • Ran the ClawSweeper repair loop before final review.
  • Addressed earlier ClawSweeper review findings before merge.
  • Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
  • Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

The automerge loop is complete.

Automerge progress:

  • 2026-05-04 21:04:52 UTC review passed becdea4223be (structured ClawSweeper verdict: pass (sha=becdea4223be0cbb6806d92d11ca4307d19bf...)
  • 2026-05-04 19:26:55 UTC review queued becdea4223be (queued)
  • 2026-05-04 21:05:08 UTC merged becdea4223be (merged by ClawSweeper automerge)

@sallyom

sallyom commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper explain why automerge is blocked. plugin-sdk:api:check and Critical Quality (plugin-sdk-package-contract) are green on the current head, but automerge still appears stuck on the Plugin SDK API baseline finding.

@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper is taking a look at your question.

I asked ClawSweeper to answer this maintainer mention in the next review comment. Tiny claws, bounded scope: this is a read-only assist pass unless it produces one of the existing structured safe-action markers.

Request: explain why automerge is blocked. plugin-sdk:api:check and Critical Quality (plugin-sdk-package-contract) are green on the current head, but automerge still appears stuck on the Plugin SDK API baseline finding.

@clawsweeper
clawsweeper Bot merged commit 02ac7dc into openclaw:main May 4, 2026
107 of 108 checks passed
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
)

Summary:
- The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
- Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Addressed earlier ClawSweeper review findings before merge.
- Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
- Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

Validation:
- ClawSweeper review passed for head becdea4.
- Required merge gates passed before the squash merge.

Prepared head SHA: becdea4
Review: openclaw#77423 (comment)

Co-authored-by: sallyom <[email protected]>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
markfietje pushed a commit to markfietje/openclaw that referenced this pull request May 20, 2026
Summary:
- The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
- Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Addressed earlier ClawSweeper review findings before merge.
- Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
- Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

Validation:
- ClawSweeper review passed for head becdea4223be0cbb6806d92d11ca4307d19bfc3f.
- Required merge gates passed before the squash merge.

Prepared head SHA: becdea4223be0cbb6806d92d11ca4307d19bfc3f
Review: openclaw/openclaw#77423 (comment)

Co-authored-by: sallyom <[email protected]>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
markfietje pushed a commit to markfietje/openclaw that referenced this pull request May 20, 2026
Summary:
- The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
- Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Addressed earlier ClawSweeper review findings before merge.
- Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
- Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

Validation:
- ClawSweeper review passed for head becdea4223be0cbb6806d92d11ca4307d19bfc3f.
- Required merge gates passed before the squash merge.

Prepared head SHA: becdea4223be0cbb6806d92d11ca4307d19bfc3f
Review: openclaw/openclaw#77423 (comment)

Co-authored-by: sallyom <[email protected]>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
)

Summary:
- The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
- Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Addressed earlier ClawSweeper review findings before merge.
- Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
- Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

Validation:
- ClawSweeper review passed for head becdea4.
- Required merge gates passed before the squash merge.

Prepared head SHA: becdea4
Review: openclaw#77423 (comment)

Co-authored-by: sallyom <[email protected]>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
@sallyom
sallyom deleted the issue-77350 branch May 29, 2026 15:15
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
)

Summary:
- The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
- Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Addressed earlier ClawSweeper review findings before merge.
- Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
- Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

Validation:
- ClawSweeper review passed for head becdea4.
- Required merge gates passed before the squash merge.

Prepared head SHA: becdea4
Review: openclaw#77423 (comment)

Co-authored-by: sallyom <[email protected]>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
)

Summary:
- The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
- Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Addressed earlier ClawSweeper review findings before merge.
- Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
- Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

Validation:
- ClawSweeper review passed for head becdea4.
- Required merge gates passed before the squash merge.

Prepared head SHA: becdea4
Review: openclaw#77423 (comment)

Co-authored-by: sallyom <[email protected]>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
zeekay pushed a commit to hanzoai/bot that referenced this pull request Sep 11, 2026
Summary:
- The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
- Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Addressed earlier ClawSweeper review findings before merge.
- Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
- Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

Validation:
- ClawSweeper review passed for head becdea4223be0cbb6806d92d11ca4307d19bfc3f.
- Required merge gates passed before the squash merge.

Prepared head SHA: becdea4223be0cbb6806d92d11ca4307d19bfc3f
Review: openclaw/openclaw#77423 (comment)

Co-authored-by: sallyom <[email protected]>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
zeekay pushed a commit to hanzoai/bot that referenced this pull request Sep 11, 2026
Summary:
- The PR removes `max` from OpenRouter DeepSeek V4 thinking profiles, maps stale OpenRouter `max` overrides to `xhigh`, preserves direct DeepSeek behavior, and updates docs, tests, and changelog.
- Reproducibility: yes. Source inspection on current main shows OpenRouter DeepSeek V4 advertises `max` and se ... ffort: "max"`, matching the linked 400 logs; I did not need a live OpenRouter request for this assist pass.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Addressed earlier ClawSweeper review findings before merge.
- Included post-review commit in the final squash: docs(changelog): credit OpenRouter duplicate fix
- Included post-review commit in the final squash: fix(openrouter): keep DeepSeek V4 reasoning effort valid

Validation:
- ClawSweeper review passed for head becdea4223be0cbb6806d92d11ca4307d19bfc3f.
- Required merge gates passed before the squash merge.

Prepared head SHA: becdea4223be0cbb6806d92d11ca4307d19bfc3f
Review: openclaw/openclaw#77423 (comment)

Co-authored-by: sallyom <[email protected]>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge docs Improvements or additions to documentation maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeepSeek V4 Pro on OpenRouter fails with 400 reasoning_effort: Invalid option (regression in 2026.5.3-1)

1 participant