rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:icrefin/dsh-provider-model-picker
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Provider + Model — the composer's model control names the provider beside the model: DeepSeek Demo/DeepSeek-V4.1-Flash instead of DeepSeek-V4.1-Flash.
English | 简体中文
The shipped picker prints the catalog model name alone, which is ambiguous as soon as two providers offer a model with the same name, or as soon as the model is not the one you think the session is on. This plugin keeps the control exactly where it is and adds the one fact it was missing.
before after
┌──────────────────────────────┐ ┌───────────────────┐ ┌──────────────────────────────────┐
│ Ask anything… │ │ DeepSeek-V4.1-F… ▾│ │ DeepSeek Demo/DeepSeek-V4.1-F… ▾ │
│ │ └───────────────────┘ └──────────────────────────────────┘
│ 📊 DeepSeek-V4.1-Flash ▾ │ ⤴ the trigger this plugin re-registers
└──────────────────────────────┘
| Surface | What it does |
|---|---|
conversation.input.model |
re-registered at a lower priority than the shipped picker, rendering this plugin's trigger (Provider/Model + reasoning effort) and its two-level menu |
Locale namespace dsh-provider-model-picker |
English and Simplified Chinese copy for the control |
| Composer row CSS variables | honours the host's --dsh-composer-model-text-display / --dsh-composer-model-icon-display compact switch like the shipped occupant |
No host route, no service, no Config: the host half (exports["."]) exists only so
the Loader row can carry the browser half (exports["./client"]).
| Directory state | Trigger shows |
|---|---|
| Model loaded in the catalog | Provider/Model — the catalog provider name, or the localized DeepSeek Account for the account provider |
| Model missing from the catalog (removed, or its group failed to load) | Provider/model-id, using the group's name when known and the raw provider id otherwise |
| No catalog yet | the shipped forms: Loading models…, then Select model |
The reasoning effort keeps its own caption beside the label
(DeepSeek Demo/DeepSeek-V4.1-Pro · High), and the trigger's accessible name and
tooltip use the same provider-qualified string.
A model that advertises no reasoning levels gets no caption and no Effort row —
the control offers only what the adapter publishes, exactly like the shipped
picker, because the host rejects an effort its adapter never advertised. For a
dsh-llm-pi-ai route that capability is the model entry's reasoningEfforts
(omit the field to keep the installed catalogue's own metadata):
- id: llm-pi-ai
name: "@deepseek-ai/dsh-llm-pi-ai"
config:
providers:
baidu-team:
models:
- id: deepseek-v4.1-flash
name: BD DeepSeek-V4.1-Flash
# level name → the wire value dispatch sends; only `off` may be empty
reasoningEfforts:
low: low
medium: medium
high: high
The level names are off, minimal, low, medium, high, xhigh, max.
Declaring them is a host-configuration change, not a plugin one: the same levels
then appear in /model and in this control's Effort row.

Both panels come from tools/preview.mjs, which renders the built bundle outside
the GUI over a fake catalog. On the left, the trigger names the provider and the
root pane drills into Model and Effort; on the right, the model pane lists every
provider group — and DeepSeek Demo and Baidu Team both offer
DeepSeek-V4.1-Flash, which the bare model name cannot tell apart.
conversation.input.model is a single slot — one occupant per cell, and the
slot registry renders the lowest live priority, keeping the higher entry
registered. The shipped picker (@deepseek-ai/dsh-client-ui-model-selection)
registers at the default 0; this plugin registers at -1.
That choice buys three things:
/model command popup is untouched./model read the same
per-session directory instance (ctx.modelDirectories), so a switch made in one
is what the other shows next.If another occupant already holds priority: -1, the registration is refused —
the plugin logs and leaves the shipped picker alone rather than breaking the
composer's own registration.
Because shadowing the seat means owning it, the plugin also ships the picker
underneath: the root Model/Effort cells, provider-grouped model list, search past
four models, reasoning-effort levels, pending spinner, keyboard navigation
(↑/↓ walk rows, Tab accepts or leaves a drilled pane, Escape back/closes),
and an in-menu error strip with Retry.
The registration is held by an effect, and the effect hands back the slot's own disposer: unloading the plugin removes the occupant instead of leaving a dead entry in the registry, at which point the shipped picker renders again.
inject lists remote and remote.session, which this plugin never touches
directly. They are there for the callee, not the caller.
ctx.modelDirectories is a cordis service proxy: it rebinds this to the
caller's context for the duration of the call. directoryFor() builds a
session's directory from this.ctx.remote.session — but only on a cache miss,
i.e. the first call for a session that no other surface has warmed yet. So the
call succeeds or dies depending on who asked first:
| Who calls first for that session | Result |
|---|---|
The shipped picker or the /model popup (they declare remote.session) |
Directory built and cached; a later call from anywhere is a cache hit |
This plugin, at priority: -1, before the shipped entry renders |
cannot get property "remote.session" without inject |
That is why the defect looked intermittent and session-shaped: any session whose directory happened to be warm worked, and a session switch — a new session, this entry first — failed every time. The shipped package declares the same two services for the same reason.
test/support.ts enforces the rule in its directory double, so dropping either
declaration fails the suite instead of the GUI.
packageManager, which corepack enable picks up.>=0.2.2-rc.2 <0.2.3-0, the range this plugin's peer dependencies
and its SlotMap typing are built against. A wrong slot id or option fails the
typecheck.lib/ is not committed. The published tree is TypeScript source, so build
before installing the bundle.git clone https://github.com/icrefin/dsh-provider-model-picker.git
cd dsh-provider-model-picker
pnpm install
pnpm build # tsc -> lib/, tsdown -> lib/client.js
sh scripts/install.sh # packs dist/dsh-provider-model-picker-0.3.8.tgz, prints the install steps
pnpm check runs everything CI runs — tsc over the host half and the browser
half, the bundle build, then 81 vitest cases in six files:
pnpm check # typecheck both halves, build, 81 tests
Install the tarball from Settings → Plugins, or with a CLI-managed profile:
sh scripts/install.sh --profile <profile>
Adding a bundle to a running profile needs a restart: the harness computes its module resolution at boot, so an entry installed while it runs reports "failed to import" until the next start.
Three rules that follow from how a profile pins a local install:
package.json gets
"dsh-provider-model-picker": "file:…/dist/dsh-provider-model-picker-<version>.tgz".
Deleting or replacing that file makes the next install fail with ENOENT
before it can update anything. Keep the tarball, or remove the bundle first and
install the new version after.Nothing to configure: the plugin has no Loader config, no settings section and no
stored state. Install it and the composer's model control is the provider-named
one; /model keeps working and reads the same per-session directory, so a switch
made in either surface is what the other shows next.
| Interaction | Result |
|---|---|
| Click the trigger | the root pane: Model (the current Provider/Model) and Effort (the current level, only for a model that advertises levels) |
| Model → a provider group | that provider's models, in catalog order, account provider first |
| Type in the search field | appears past four models; matches as a case-insensitive ordered subsequence of the name, prefix hits first |
| Effort → a level | resubmits the same provider and model with the new level |
↑ / ↓ |
walk the rows, wrapping at both ends |
Tab |
accepts the focused row; Shift+Tab steps back out of a drilled pane |
Escape |
steps back to the root pane, then closes and returns focus to the trigger |
| A submitted selection | a spinner on the pending row until the host answers; a rejection keeps the menu open with the reason and a Reload button |
The registry retires an entry whose render throws and re-renders the cell onto the next survivor — for this seat, the shipped picker. That is the right fallback, but it is silent: the reason only reaches the page console, which a user without developer tools cannot read. So the seat reports itself, and the two failure paths are deliberately different:
picker error: <reason> — click to use the default picker and stays. The
injection factory is the only call this plugin makes outside its own component
tree, so a throw there retires the seat with nothing on screen to explain it;
every step of that factory is therefore guarded, and the result is a message
instead. Clicking the message throws, which is what hands the cell back to the
shipped picker.console.info('[dsh-provider-model-picker] shadowed …') on registration and
console.error('[dsh-provider-model-picker] …') on failure name the plugin, so
"which picker am I looking at?" is answerable from developer tools.The directory store is read through guards as well (getSnapshot/subscribe):
switching sessions can tear a session scope down under a live component, and a
throw in that read happens inside the renderer — retiring the seat for every
session, not just the one that went away.
Every value read from the directory snapshot is also normalised before use
(asArray, id fallbacks, name fallbacks): the snapshot crosses a plugin boundary,
and a shape this build did not anticipate must degrade to an empty row rather than
throw inside the renderer and cost the whole seat. That normalisation fixed the
first live defect — version 0.2.0 registered, rendered once, then threw on a
catalogue shape it did not expect and was retired.
ctx.modelDirectories) belongs to @deepseek-ai/dsh-client-ui-model-selection;
with that bundle disabled there is no catalog to read, so this control could not
select anything. The dependency is declared in dsh.client.inject.dpmp- prefix instead of importing
@deepseek-ai/dsh-client-ui-primitives, so a primitive revision cannot blank
the seat — at the cost of tracking the platform's menu styling by hand.-1 is this seat's shadow priority; another
plugin claiming it wins or steps aside by load order, and the loser logs.After installing, the composer still shows the bare model name.
The browser half has not reached the open page yet. Reload the window; if that
does not take, restart the app. If it still does not appear, another occupant may
already hold priority: -1 — the plugin logs
[dsh-provider-model-picker] the model seat could not be shadowed and leaves the
shipped picker in place.
The control shows picker error: ….
That is the wiring failure face. It stays until you click it, and clicking hands
the cell back to the shipped picker. The page console carries the full reason,
prefixed with [dsh-provider-model-picker].
The trigger shows Provider/model-id instead of the model's display name.
The saved model is no longer in the loaded catalog: its provider group failed to
load, or the model was removed. The menu's warning strip names the provider that
failed, and a catalog that failed to load at all gets an error strip with a
Reload button.
There is no Effort row.
That model advertises no reasoning levels, so there is nothing to choose. Declare
reasoningEfforts on the model in the host configuration (see above) and the row
appears — here and in /model.
Which picker am I looking at?
console.info('[dsh-provider-model-picker] shadowed "conversation.input.model" at priority -1') is printed when this plugin's entry is registered, and
console.error names it on every failure. If only the shipped messages appear,
this plugin did not register.
MIT — see LICENSE.
If this control saves you from guessing which provider a session is on, a ⭐ star helps other DSH users find it.
An independent plugin for DeepSeek Harness 0.2.2-rc.2 · MIT licensed.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。