Provider-folded model selector for the DSH Web composer with catalog-driven reasoning effort choices.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-model-accordion
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:lakabuji-arch/dsh-model-accordion
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Provider-folded model selector for the DeepSeek Harness (dsh) Web composer.
This repository is the source of truth. The published npm package embeds a snapshot of this README and of the source comments taken at publish time (
0.4.0). Documentation fixes land here first and only reach npm with the next release, so when the two disagree — including the description shown on the npm page — this repository and itsmainbranch are authoritative.以本仓库为准。 npm 包里的 README 与源码注释是发布瞬间的快照(
0.4.0),之后修正的文档 只会先落在本仓库;两者不一致时(包括 npm 页面上显示的描述),以这里为准。
What it does
- Replaces the composer model seat (
conversation.input.model) with a provider-folded selector: provider groups stay collapsed until opened, and the provider holding the current model opens on a fresh menu. - Keeps the
0.2.xseat contract: same seat name, sameinjectface (available/directory/load/select), same rawRemoteResulthandling. - Reasoning effort. Picking a model submits its catalog-declared default effort; the trigger and every model row show the active level; a cell in the menu drills into the levels the model actually declares. There is no client-owned effort table, so an undeclared level is never offered.
- Label child seat. The seat declares
conversation.input.model.labeland renders it throughrenderSlot(), so the official1017badge — and any other plugin that decorates model names — keeps working instead of being bypassed. - The popup is portaled to
document.bodyand positioned with fixed coordinates clamped to the viewport, so composer overflow cannot clip it; it follows page scroll and resize. - Directory
failuresare listed per provider with a retry action, and the catalog error is shown as模型操作失败:…; asession/writer-heldrejection gets the dedicated "session already in use" message instead of a raw error. - Search is available at every catalog size (the
0.2.xbehaviour) and ranks by ordered-subsequence match on the model name only — descriptions and ids are excluded so prose cannot drag unrelated models into the result list. - Uses DSH semantic theme tokens (light/dark) and a built-in
model-accordionlocale dictionary (zh+en) registered on the client locale service and named on the seat. - Honours a catalog model's
badge({ tone, text }) the way the official seat does — before the name on the trigger, after it in the menu — and localizes its text throughresolveTextwhen the seat injects one.
Requirements
- DeepSeek Harness Web
0.2.x(verified against0.2.2-rc.1; the seat shape is unchanged from0.2.1-rc.2). - A Web profile with the official model-selection package and model-directory service.
- React 18 supplied by the DSH Web runtime.
This is a Web UI plugin with a small host half: it adds no Host service, model provider, vision
backend, or model catalog, and its host side only registers one agent/request-error listener for
the effort fallback described above. Provider availability and image-session admission remain
controlled by DSH and any installed provider/vision plugins.
Install from a package or repository
dsh plugin --profile web add dsh-model-accordion
For a local checkout during development:
dsh plugin --profile web add file:/absolute/path/to/dsh-model-accordion
Refresh the Web UI after installation. The package declares a dsh.bundle patch and a Web client
entry, so it is installed and loaded as a persistent profile bundle rather than a temporary runtime
extension.
Configuring reasoning levels
The selector never invents levels: it renders exactly what the model's catalog entry declares, and that declaration lives in the DSH profile config, not in this plugin.
For llm-pi-ai (relay / custom) models the declaration is reasoningEfforts in the profile patch:
- id: llm-pi-ai
config:
providers:
company:
models:
- id: deepseek-flash
reasoningEfforts:
low: low
high: high
max: ultra # key = DSH level, value = wire value sent upstream
Rules:
- The key must be one of DSH's thinking levels:
off,minimal,low,medium,high,xhigh,max. Any other key fails the wholellm-pi-aischema validation, and every provider under that plugin disappears from the picker (aturbo:key does exactly that). - The value is the string sent upstream and may be anything the gateway accepts — including a
level DSH has no name for.
max: ultrashows Max in the picker and sendsultra. - Mapping works the other way too:
off: noneturns DSH's Off into the gateway'snone. - A level you omit is pinned to unsupported (pi-ai receives
null), so the picker will not offer it;reasoningEfforts: falsedeclares a non-reasoning model. - The default shown by the picker comes from the adapter's
defaultEffort. When the adapter declares none, the picker showsDefaultand the request carries no effort (the provider decides).
中文说明
选择器里的挡位不是插件写死的,而是读 DSH 配置里模型声明的 reasoningEfforts:
- 键必须是 DSH 认识的七个之一:
off / minimal / low / medium / high / xhigh / max。 写成别的(比如turbo)会让整个llm-pi-ai配置校验失败,该插件下所有 provider 会一起消失。 - 值是真正发给上游的字符串,随便写。上游有、DSH 没有的挡位就用「映射」:
max: ultra—— UI 上显示 Max,实际发ultra。 - 反过来也行:
off: none—— UI 上的 Off 发none。 - 没写的挡位会被标成「不支持」,选择器不会显示;
reasoningEfforts: false表示这个模型不支持推理。 - 默认挡位来自适配器的
defaultEffort;适配器没声明时显示Default,请求里不带挡位(由网关决定)。
Behavior and limitations
- The seat registers with
priority: -1so it sits in front of the official picker instead of rendering next to it. - The seat factory declares
remote/remote.sessionnext to the services it uses, and a directory-resolver failure is tagged (dsh-model-accordion: model directory unavailable …) before it is rethrown, so the slot host still falls back to the official picker while the console keeps a searchable reason instead of a bare "slot entry crashed". - A subagent-addressed session renders nothing (the official seat does the same); a locked composer disables the trigger.
- Selection rejections render as an in-menu strip rather than the shared composer toast, so the plugin stays dependency-free on DSH UI primitives.
- Effort is only offered where the catalog declares it: a relay model without
reasoningmetadata shows no effort control, and the request keeps the provider default (shown asDefault). - An effort the model no longer declares is never sent blindly: the seat shows — and once
re-selects — the model default (falling back to the first declared level), and a selection the
host rejects with
UNSUPPORTED_REASONING_EFFORTis retried once with that fallback. - If the upstream rejects the effort (the catalog declaration is a client-side promise, not a
gateway guarantee), the host half hooks
agent/request-error, drops the pinned effort to the provider default for the same provider/model, and replaces the raw gateway body with an error that says what happened and whichreasoningEffortsdeclaration to fix; the seat shows the same notice. The turn is not resent on its own: the loop retries with the selection frozen at step start, so a mid-turn switch cannot reach the wire — resend the message after the switch. - Search input is retained across menu opens; clearing it collapses the accordion back to the provider holding the current model.
Development checks
node --check lib/client.js
node --check lib/index.js
node --test tests/package.test.js tests/render.test.js
npm pack --dry-run --ignore-scripts
tests/render.test.js executes the shipped bundle against a small hook runtime, so the component
body, store handling, child-seat rendering and menu structure are covered without a browser.
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10562
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10562
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8043
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7387
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5269
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1040
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.