DeepSeek Harness Model Selector Grouping Plugin

Introduction

The official model selector in DeepSeek Harness (DSH) lays out dozens of models in a single long flat list. Once you’ve connected three or five relay stations, scrolling through it becomes quite painful—especially when the same model appears across multiple endpoints, making it easy to accidentally select the wrong route.

luoqiusang/dsh-model-picker-groups is a standalone plugin that adds per-provider group collapsing, a persistent search bar, and a favorites feature to DSH’s dialog model selector. It replaces the official conversation.input.model slot while preserving the native look and keyboard navigation—only the list organization changes.

About the Plugin

  • Name: dsh-model-picker-groups
  • Maintainer: luoqiusang
  • Type: Client plugin
  • Repository: https://github.com/luoqiusang/dsh-model-picker-groups
  • License: MIT

The plugin depends on DSH’s official ui-model-selection plugin and is implemented by forking its build artifacts.

Core Features

Group Collapsing

On open, only the group containing the current model is expanded; all others are collapsed. Click a group title to freely expand/collapse, and multiple groups can be open simultaneously.

Opening the menu goes directly to the model list with focus on the search box. Search matches model name, model ID, and group name; a hit temporarily expands that group. Esc follows a three-level ladder (clear search → return to the “Model / Inference Level” root panel → close).

Top Favorites

When the search field is empty, a “Favorites” group is rendered at the top. Favorites are stored by route ID + model ID (to avoid selecting the wrong endpoint for same-named models) and persist across sessions via localStorage. The favorites group itself is also collapsible.

Same-Name Route Merging

When multiple endpoints share the same displayName, they are merged into one group to prevent the same model from appearing repeatedly.

Merge rules:
- The merged group name takes the first route’s displayName; the group’s model count equals the sum across all routes;
- Each model row remembers which route it came from, and the selection still submits via that original route;
- If model IDs within the group are duplicated, the row label is suffixed with · <route id>—otherwise the two rows are visually indistinguishable;
- Routes without a displayName fall back to the route ID, form their own standalone group, and do not participate in merging.

Keyboard & Accessibility

↑↓ / Enter / Esc / Tab are preserved; aria-expanded / aria-activedescendant strictly correspond to the rendered rows.

Inference Level Entry

Click the inference-level badge at the bottom (e.g., High) to jump directly into the inference level list; click again to collapse.

Installation & Activation

On desktop, go to Settings → Plugins in-app and install from the repository https://github.com/luoqiusang/dsh-model-picker-groups.

It has not yet been published to npm or any plugin marketplace. The plugin manager will automatically apply bundle.patch, so it takes over as soon as installed—no manual profile editing required.

Manual / Offline Installation

Place the repository under the profile’s node_modules, then disable the official plugin in the profile’s cordis.patch.yml and insert this plugin.

Windows

git clone https://github.com/luoqiusang/dsh-model-picker-groups.git D:\path\to\dsh-model-picker-groups
powershell -NoProfile -ExecutionPolicy Bypass -File D:\path\to\dsh-model-picker-groups\install.ps1

install.ps1 will:
1. Create a junction at %USERPROFILE%\.dsh\profiles\<profile>\node_modules\dsh-model-picker-groups pointing to the repository;
2. Back up cordis.patch.yml;
3. Append a patch section wrapped in # >>> dsh-model-picker-groups / # <<< dsh-model-picker-groups markers (idempotent—re-running only replaces that section; if the markers are absent but name: dsh-model-picker-groups already exists, it is treated as already mounted and skipped):

- id: ui-model-selection
  disabled: true
- insert:
    - id: model-picker-groups
      name: dsh-model-picker-groups

After saving, the client hot-reloads the plugin—no DSH restart needed.

Other Platforms

Create a symbolic link under <DSH profile>/node_modules/ pointing to this repository, then manually write in the YAML snippet above.

Uninstall

powershell -NoProfile -ExecutionPolicy Bypass -File D:\path\to\dsh-model-picker-groups\uninstall.ps1

Removes the junction and the patch section; the official selector is restored immediately.

How It Works

lib/client.js is not hand-written—it’s a stitched artifact of “official bundle + local fragments”:

Official client.js inside app.asar
  ├── 11 //#region markers (script validates order by name)
  ├── 6 segments: kept as-is
  └── 5 segments: wholesale replaced by files under src/
        src/css.js            ← Styles (collapsing / favorites / back button / dividers)
        src/provider-order.js ← Same-name route merging
        src/ModelSelect.js    ← Component body (collapsing, search, favorites, scrolling)
        src/locales.js        ← English & Chinese strings
        src/index-region.js   ← Plugin registration & /model popup

scripts/build.py: parses the app.asar header → extracts the official bundle → validates the 11-region order → replaces 5 segments → performs a global rename → writes out lib/client.js, lib/index.js, package.json, and cordis.patch.yml.

Modification workflow:
1. Edit lib/client.js
2. --emit to write back to src/
3. --check must PASS
4. node --check lib/client.js
5. node scripts/test-model-rows.mjs (regression tests)

Why not “just edit app.asar” directly? Its 18,188 entries each carry integrity checksums—modifying bytes breaks the integrity check; repackaging means redoing it every time DSH upgrades. The plugin form is reversible, hot-reloadable, and doesn’t touch the installation directory.

Compatibility

Item Requirement
DSH dsh-client-ui-model-selection from 0.2.1-rc.3 (this plugin is forked from that version’s build artifacts)
Platform Web client (both desktop Electron and browser)
Browser engine Chromium 105+ (uses CSS :has())
Node ≥ 22 (only needed for local rebuilds)

After a DSH upgrade, changes to the official bundle will cause rebuild failures (the script reports region validation errors). At that point, re-run --emit and merge the diffs.

Known Limitations / Unverified

  • IME acceptance (not yet reproduced with a real Windows IME): type pinyin → press Enter to confirm the candidate → the menu should stay open and the model should not change.
  • /model load-failure rows are informational only and do not switch models; the current official popupSelect does not support disabled rows or cancelling a successful close—clicking an informational row still causes the host to close the popup (pending a host-provided “reject selection” API).
  • Relies on official internal structures (region markers, MenuGroup’s data-menu-group-* attributes, MenuSurface and CSS class names, slot names)—a major DSH version upgrade will inevitably require a rebuild.
  • Group titles do not stick to the top: sticky headers require an opaque background, but the official theme’s accent color is a 10%-opacity token; combined with the height changes caused by collapsing, titles would continuously overlap model rows and compete for space. So titles scroll with the list.
  • Favorites can only be toggled by mouse click (favorite rows support keyboard selection of models, but the star icon itself is not in the itemRefs keyboard sequence).
  • If localStorage is unavailable, favorites only persist for the current session.
  • Only the dialog selector is modified; the /model command popup still uses official rendering (but shares the same-name route merging and favorites data).

Use Cases & Caveats

Ideal for developers managing multiple endpoints who want to switch models quickly or reduce accidental clicks.

The plugin runs with the current dsh process privileges. Review the source code and license before installing. The plugin depends on official internal structures; a major DSH version upgrade may require a rebuild.

Summary

This plugin makes the DSH model selector more user-friendly through group collapsing, persistent search, and favorites—especially useful in multi-endpoint scenarios. Implemented by forking official build artifacts, it is reversible, hot-reloadable, and does not break official integrity checks.

  • Directory page: https://www.skillhub.cn/plugins/luoqiusang/dsh-model-picker-groups
  • GitHub: https://github.com/luoqiusang/dsh-model-picker-groups
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye