Skip to content

fix: expose session-specific thinking levels#76548

Merged
amknight merged 4 commits into
mainfrom
ak/issue-76482-deepseek-v4-pro-think-command-ui-omits-xhigh-and
May 3, 2026
Merged

fix: expose session-specific thinking levels#76548
amknight merged 4 commits into
mainfrom
ak/issue-76482-deepseek-v4-pro-think-command-ui-omits-xhigh-and

Conversation

@amknight

@amknight amknight commented May 3, 2026

Copy link
Copy Markdown
Member

Fixes #76482

Summary

DeepSeek V4 Pro exposes seven thinking levels, but session list rows and UI/TUI fallback behavior could collapse /think choices to the default model's smaller level set or to an empty list.

This PR:

  • preserves per-session thinking levels in gateway session rows
  • fixes TUI /think autocomplete fallback for empty arrays
  • avoids using default-model thinking levels when the active session uses a different model
  • adds regression coverage for gateway, TUI, and Control UI slash-command behavior

Tests

Reported by the local fanout worker:

  • src/gateway/server.sessions.list-changed.test.ts — pass
  • src/tui/commands.test.ts — pass
  • ui/src/ui/chat/slash-command-executor.node.test.ts — pass
  • extensions/deepseek/index.test.ts — pass
  • src/auto-reply/thinking.test.ts — pass
  • oxfmt formatting check — pass

Local orchestration report

A local, uncommitted fanout report exists at:

/Users/aknight/Development/worktrees/openclaw-issues/_runs/20260503T072204Z/reports/issue-76482.md

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: S maintainer Maintainer-authored PR labels May 3, 2026
@clawsweeper

clawsweeper Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

Summary
The PR hydrates lightweight gateway session rows with thinking options and updates TUI/Control UI /think fallback logic, regression tests, and the changelog.

Reproducibility: yes. Source inspection shows current main lightweight sessions.list rows can omit thinking options while browser fallback is provider-agnostic, matching the reported /think collapse for DeepSeek V4 Pro.

Next step before merge
The remaining blocker is a narrow, source-proven repair: expose the actual DeepSeek V4 thinking profile to the gateway row resolver and add focused regression coverage.

Security
Cleared: The diff is limited to TypeScript gateway/UI/TUI logic, tests, and a changelog entry, with no CI, dependency, secret, packaging, or code-loading changes.

Review findings

  • [P2] Expose DeepSeek levels through the row profile source — src/gateway/session-utils.ts:1638-1642
Review details

Best possible solution:

Expose the DeepSeek V4 thinking profile through the startup-lazy provider-policy surface or an equivalent gateway-backed contract, then verify sessions.list, TUI, and Control UI show all seven DeepSeek V4 Pro levels.

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

Yes. Source inspection shows current main lightweight sessions.list rows can omit thinking options while browser fallback is provider-agnostic, matching the reported /think collapse for DeepSeek V4 Pro.

Is this the best way to solve the issue?

No. The fallback changes are directionally useful, but relying on lightweight row hydration is incomplete until the real DeepSeek V4 profile is available to the gateway path that builds those rows.

Full review comments:

  • [P2] Expose DeepSeek levels through the row profile source — src/gateway/session-utils.ts:1638-1642
    This new lightweight-row hydration still depends on listThinkingLevelOptions, but the startup-lazy resolver can only see active registry hooks or provider-policy-api.js. DeepSeek's public policy artifact does not export resolveThinkingProfile, and the manifest catalog does not declare xhigh/max, so a deepseek-v4-pro row can still resolve only the base labels unless the full plugin runtime is already loaded. Add the DeepSeek V4 profile to the public policy path, or another gateway-owned profile source, and cover the actual deepseek/deepseek-v4-pro max case.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.88

Acceptance criteria:

  • pnpm test src/gateway/server.sessions.thinking-e2e.test.ts src/gateway/server.sessions.list-changed.test.ts src/gateway/session-utils.test.ts extensions/deepseek/provider-policy-api.test.ts extensions/deepseek/index.test.ts ui/src/ui/chat/slash-command-executor.node.test.ts src/tui/commands.test.ts
  • pnpm exec oxfmt --check --threads=1 src/gateway/session-utils.ts src/gateway/server.sessions.thinking-e2e.test.ts extensions/deepseek/provider-policy-api.ts extensions/deepseek/provider-policy-api.test.ts ui/src/ui/chat/slash-command-executor.ts ui/src/ui/chat/session-controls.ts src/tui/commands.ts
  • pnpm check:test-types

What I checked:

  • Current main lightweight rows: Current sessions.list builds rows with lightweightListRow: true, and current main intentionally returns empty thinkingLevels/thinkingOptions for lightweight rows. (src/gateway/session-utils.ts:1638, 9772ce6ce975)
  • Browser fallback is base-only: The browser-side thinking helper ignores provider/model and returns only off, minimal, low, medium, and high, so it cannot recover DeepSeek xhigh/max from an empty or base-only row. (ui/src/ui/thinking.ts:69, 9772ce6ce975)
  • DeepSeek full runtime profile has seven levels: The full DeepSeek plugin defines off, minimal, low, medium, high, xhigh, and max and exposes them through resolveThinkingProfile. (extensions/deepseek/index.ts:11, 9772ce6ce975)
  • DeepSeek startup-lazy policy lacks the profile: The public DeepSeek provider-policy-api.ts artifact only exports config normalization, while the core resolver's startup-lazy fallback looks for resolveThinkingProfile on that artifact. (extensions/deepseek/provider-policy-api.ts:44, 9772ce6ce975)
  • PR diff still misses real DeepSeek profile coverage: The latest PR changes lightweight rows to call listThinkingLevelOptions, but its new gateway e2e test uses a synthetic test-extended catalog with xhigh and does not assert actual deepseek/deepseek-v4-pro returns all seven labels including max. (src/gateway/server.sessions.thinking-e2e.test.ts:76, c3baca493e45)
  • Exact-head CI state: GitHub check runs for head c3baca493e459960edebe53318ee88beaad0cdb4 show check and check-test-types failing, with some checks still in progress during review. (c3baca493e45)

Likely related people:

  • vincentkoc: Local blame/log point the current thinking-profile, DeepSeek provider, gateway row, and Control UI fallback surfaces to commit c7bbb3f, which also appears in recent changelog ownership for adjacent plugin work. (role: recent maintainer; confidence: high; commits: c7bbb3f9af36; files: extensions/deepseek/index.ts, extensions/deepseek/provider-policy-api.ts, src/gateway/session-utils.ts)

Remaining risk / open question:

  • Exact head c3baca493e459960edebe53318ee88beaad0cdb4 still has a failing check-test-types gate.
  • The new regression test can pass without exercising the actual DeepSeek V4 Pro max profile path that users reported.

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

@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label May 3, 2026
@amknight
amknight marked this pull request as ready for review May 3, 2026 10:38
amknight added 2 commits May 3, 2026 21:10
…UI (#76482)

The Control UI cannot resolve provider-specific thinking levels client-side
(ui/src/ui/thinking.ts always returns base 5 levels). The gateway must
provide them even in lightweight rows. listThinkingLevelOptions is a cheap
in-memory lookup — negligible perf impact vs the transcript/cost/model ops
that the lightweight flag still skips.

Also update existing test assertions that expected thinkingOptions: [] for
lightweight rows (flagged by ClawSweeper review).
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M and removed size: S labels May 3, 2026
@amknight

amknight commented May 3, 2026

Copy link
Copy Markdown
Member Author

E2E validation found the gateway change is needed — the Control UI cannot resolve provider-specific thinking levels client-side (ui/src/ui/thinking.ts always returns base 5 levels, no plugin registry access). Consumer-side fallback alone is insufficient for the browser path.

Changes since initial review:

  • Gateway: keep listThinkingLevelOptions in lightweight rows — it's a pure in-memory lookup (~0.1ms/call), negligible vs the transcript/cost/model ops the lightweight flag still skips
  • Tests: updated session-utils.test.ts:1147 and server.sessions.list-changed.test.ts assertions that expected thinkingOptions: [] for lightweight rows (ClawSweeper finding)
  • E2E coverage: added server.sessions.thinking-e2e.test.ts — 3 integration tests proving the full gateway → consumer pipeline: extended levels resolve correctly, no cross-model leakage, default inheritance works

183 tests pass across 7 files.

@amknight
amknight merged commit 54a81e0 into main May 3, 2026
89 of 92 checks passed
@amknight
amknight deleted the ak/issue-76482-deepseek-v4-pro-think-command-ui-omits-xhigh-and branch May 3, 2026 11:38
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
* fix: expose session-specific thinking levels (openclaw#76482)

* fix: preserve lightweight sessions.list contract, fix consumer-side fallbacks only

* fix: include thinking levels in lightweight session rows for Control UI (openclaw#76482)

The Control UI cannot resolve provider-specific thinking levels client-side
(ui/src/ui/thinking.ts always returns base 5 levels). The gateway must
provide them even in lightweight rows. listThinkingLevelOptions is a cheap
in-memory lookup — negligible perf impact vs the transcript/cost/model ops
that the lightweight flag still skips.

Also update existing test assertions that expected thinkingOptions: [] for
lightweight rows (flagged by ClawSweeper review).

* test: add e2e regression tests for thinking level pipeline (openclaw#76482)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* fix: expose session-specific thinking levels (openclaw#76482)

* fix: preserve lightweight sessions.list contract, fix consumer-side fallbacks only

* fix: include thinking levels in lightweight session rows for Control UI (openclaw#76482)

The Control UI cannot resolve provider-specific thinking levels client-side
(ui/src/ui/thinking.ts always returns base 5 levels). The gateway must
provide them even in lightweight rows. listThinkingLevelOptions is a cheap
in-memory lookup — negligible perf impact vs the transcript/cost/model ops
that the lightweight flag still skips.

Also update existing test assertions that expected thinkingOptions: [] for
lightweight rows (flagged by ClawSweeper review).

* test: add e2e regression tests for thinking level pipeline (openclaw#76482)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix: expose session-specific thinking levels (openclaw#76482)

* fix: preserve lightweight sessions.list contract, fix consumer-side fallbacks only

* fix: include thinking levels in lightweight session rows for Control UI (openclaw#76482)

The Control UI cannot resolve provider-specific thinking levels client-side
(ui/src/ui/thinking.ts always returns base 5 levels). The gateway must
provide them even in lightweight rows. listThinkingLevelOptions is a cheap
in-memory lookup — negligible perf impact vs the transcript/cost/model ops
that the lightweight flag still skips.

Also update existing test assertions that expected thinkingOptions: [] for
lightweight rows (flagged by ClawSweeper review).

* test: add e2e regression tests for thinking level pipeline (openclaw#76482)
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix: expose session-specific thinking levels (openclaw#76482)

* fix: preserve lightweight sessions.list contract, fix consumer-side fallbacks only

* fix: include thinking levels in lightweight session rows for Control UI (openclaw#76482)

The Control UI cannot resolve provider-specific thinking levels client-side
(ui/src/ui/thinking.ts always returns base 5 levels). The gateway must
provide them even in lightweight rows. listThinkingLevelOptions is a cheap
in-memory lookup — negligible perf impact vs the transcript/cost/model ops
that the lightweight flag still skips.

Also update existing test assertions that expected thinkingOptions: [] for
lightweight rows (flagged by ClawSweeper review).

* test: add e2e regression tests for thinking level pipeline (openclaw#76482)
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix: expose session-specific thinking levels (openclaw#76482)

* fix: preserve lightweight sessions.list contract, fix consumer-side fallbacks only

* fix: include thinking levels in lightweight session rows for Control UI (openclaw#76482)

The Control UI cannot resolve provider-specific thinking levels client-side
(ui/src/ui/thinking.ts always returns base 5 levels). The gateway must
provide them even in lightweight rows. listThinkingLevelOptions is a cheap
in-memory lookup — negligible perf impact vs the transcript/cost/model ops
that the lightweight flag still skips.

Also update existing test assertions that expected thinkingOptions: [] for
lightweight rows (flagged by ClawSweeper review).

* test: add e2e regression tests for thinking level pipeline (openclaw#76482)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeepSeek V4 Pro: /think command UI omits "xhigh" and "max" levels despite plugin registering all 7 (2026.5.2)

2 participants