rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:suyunxing/dsh-effort-slider
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A reasoning-effort slider that replaces the shipped model selector in the dsh web GUI composer. One control owns both halves of the model choice: the model list and that model's reasoning effort, which becomes a glowing rail with a starfield behind it.
中文:把 dsh 输入框里的模型选择器换成一条"星光滑轨"——模型列表与思考强度由同一个控件管,切到不支持当前档位的模型时自动落到最接近的一档,不再报错。
dsh plugin add @lolannn/dsh-effort-slider # from npm
dsh plugin add git+https://github.com/suyunxing/dsh-effort-slider # from source


The rail is drawn from the model's own reasoning.efforts, so the tick labels
change with the model — off / low / high / max on one, low / medium / high / xhigh / max on another — and the knob lands on the level the session is
actually using.
conversation.input.model (a single slot, so this shadows the
shipped selector rather than sitting next to it) at priority: -1 — a single
slot renders the lowest priority first.catalog.groups (grouped by provider) and the levels are exactly the
reasoning.efforts the current model declares (typically off / low / high / max). No hard-coded list.modelSelection projection.selectModel remote with the
explicit { provider, model, reasoningEffort } triple, so the choice applies to
the Session and is saved as the default in the background.off is a faint rim and the top level breathes; opening the panel
lifts it. The pill only keeps an outline while the halo is on.外圈光环 switch sits under the rail;
turn it off and the glow returns to the pill alone, the way it was before the
halo existed. The choice is stored in localStorage under
effort-slider:halo, so it survives a reload.z-index: 30
— above the docked panes (10) that hold the composer, below floating panes (60),
host menus (70) and dialogs (1000) — so anything opened over the composer covers
the ring instead of the ring painting over it. For overlays that sit lower in
the stack than that, the ring asks the page what is on top along the card's
edge (elementFromPoint) and steps aside while two or more probes land on a
foreign element, coming back as soon as the composer is clear again.无档位 in the model list and
degrade gracefully once selected: the rail is dimmed and the status line says so
instead of pretending to switch.| Slot | Content |
|---|---|
conversation.input.model |
the trigger (模型 · 档位) and, while open, the popup: model row, grouped model list, effort rail, level scale, status line |
conversation.input.model.label |
untouched — the shipped non-interactive label stays owner-managed |
The popup renders through react-dom's createPortal into document.body,
because the composer row can live inside a transformed/overflowing ancestor that
would clip a position: fixed child.
← → ↑ ↓ Home End.Esc closes. Direction keys are ignored while a text field
has focus, so typing in the composer never changes the effort.index.js — Host half. The bundle row exists so the browser half has an entry
to attach to; it declares no service, tool or config.client.js — the whole feature: stylesheet injection, catalogue + projection
mapping, canvas engine, controller and the slot registration.icon.svg — original artwork (pinched four-point star over a lit rail).requestAnimationFrame-driven and stops on unmount.prefers-reduced-motion: reduce disables the burst, the warp and the quake.opacity and canvas are animated; no layout thrash.getBoundingClientRect + ResizeObserver),
not from the viewport.The Host validates the triple, it does not normalize it. In
@deepseek-ai/dsh-llm → resolveCallWithInfo:
const reasoning = info.reasoning;
const requested = defaulted.reasoningEffort;
if (reasoning === void 0) {
if (requested !== void 0) throw new LlmError(`... does not support reasoning effort "${requested}"`, "UNSUPPORTED_REASONING_EFFORT");
} else {
const effective = requested ?? reasoning.defaultEffort;
if (effective !== void 0 && !reasoning.efforts.some((e) => e.id === effective)) throw new LlmError(..., "UNSUPPORTED_REASONING_EFFORT");
}
The comment above it is explicit: "no clamping or aliasing is performed." A
model with three rungs and a model with seven therefore reject each other's
levels, and the session remote wraps that rejection as
RemoteError("session/model-unavailable", …) — which used to surface as a red
切换失败:provider "…" model "…" does not support reasoning effort "…".
So resolveEffort(model, wantedId) in client.js maps the level onto the target
model before the request is built:
| Case | What is sent | Status line |
|---|---|---|
| target declares the level | it, unchanged | nothing |
| target declares other levels | the closest one | 该模型没有「medium」档,已自动切到最接近的「low」 |
| target declares no reasoning | the field is omitted | 「<model>」没有思考强度档位,已按模型默认运行 |
"Closest" is measured on one shared scale rather than per-provider lists, because
every adapter names its rungs from the same vocabulary:
off · none · minimal · low · medium/med · high · xhigh · max · ultra. A tie
resolves to the stronger rung — losing reasoning power is the worse of the two
surprises (high → xhigh rather than high → medium when both are one step
away). A rung whose id is not on that scale is placed by its position in its own
list, and when the id being carried is itself unknown the target's
defaultEffort (then its strongest rung) is used instead, because its distance
cannot be measured.
The last real choice is remembered in lastEffort, so
max → 无档位模型 → back returns to max instead of that model's default: the
intent survives the models that cannot express it.
safeLabeldsh-pocket installs a document-level click guard for phones: any click on a
<button>/<a> whose text content looks like a file path is cancelled with
preventDefault() + stopImmediatePropagation() and replaced by a toast
("手机上无法直接打开电脑上的文件"). Its matcher includes
/[\w.\-]+\/[\w.\-]+\.\w{1,12}/, which a model id like
workbuddy-ai/deepseek-v4.1-flash matches — so the trigger became unclickable on
mobile while working fine on the desktop.
Every label rendered as text therefore runs through safeLabel(), which turns
/ and \ into ·. aria-label and title keep the raw identifier, because
they are attributes and the guard only reads textContent.
modelCatalog().default is the deployment default and can differ from what a
Session really runs (a Session-local override). Spreading it into a commit
silently switched the model while the user only meant to change the effort.
So the controller follows the Session's durable projection — the same source the shipped selector reads:
sessions.binding(sessionId).session.projections.faceOf("modelSelection")
// -> ObservableSnapshot<{ lastUsed, next }>, next = pending ?? lastUsed
model/selection carries the user's intent immediately (pending), and
request/header records what a request actually used (lastUsed). Two details
matter:
getSnapshot(); reading a
projection nobody observes can return no value at all.conversation.input.model resolves to this plugin (priority: -1, active) and
the shipped registrant goes inactive.选择模型与思考强度 — <model> · <effort>; changing the level
propagates through selectModel into the projection and back into the label.medium (on a seven-rung model) to an off/low/high/max model sends
low and reports the substitution; switching to a no-reasoning model sends no
reasoningEffort at all; switching back restores medium.npm test runs four harnesses (effort mapping, model switch, halo, refresh
queue), 87 assertions in total.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。