DeepSeek Harness Plugin: zcode-Style Model Selector

Preface

Switching models and adjusting reasoning effort intensity in DeepSeek Harness (DSH) are high-frequency operations. The native input toolbar selector isn’t intuitive enough for complex scenarios: provider and model lists are often crammed together, making it easy to accidentally trigger the wrong model during switching, and the reasoning effort levels lack visual feedback. For agent developers who frequently tune parameters and compare different model performances, these details significantly lengthen iteration time.

A zcode-style two-level model selector provides a clearer entry point: the left side is a provider column, the right side is a model list you can switch through by hovering, and beneath the models there’s a draggable reasoning effort slider. Once selected, parameters are automatically backfilled into the current session—no manual copy-paste needed.

What Is This

dsh-model-picker is a DSH plugin that replaces the model selection seat in the input toolbar row. It provides two-level model selection (Provider / Model), supports hover-to-switch and a reasoning effort slider, and automatically backfills the session upon selection. The plugin is maintained by Zjb0702, with core code hosted in a GitHub repository. All providers, models, and reasoning effort levels come from the host’s model catalog. The plugin itself does not hardcode any names—adding new models or providers only requires operations in DSH’s model / credential settings.

Core Features

Two-Level Model Selection

  • Left side: Provider list, displaying provider names.
  • Right side: Model list under the current provider; hovering with the mouse highlights the selection.
  • Provider rows and the model list share the same highlighting rules. Hovering does not change row height, padding, or borders—the list won’t jump or misalign.

Reasoning Effort Slider

  • The number of levels and their values come from the model catalog’s reasoning.efforts. As many dots are displayed as the model supports.
  • If the leftmost level is off, it means “Thinking Off.”
  • Visually aligned with zcode: 12px gradient color bar + 22px white large round thumb + one 8px white solid dot per level.
  • Thumb and dot coordinates are calculated with inset padding on both ends so they never extend beyond the bar’s edges.
  • The color bar transitions only once (120ms); transitions are disabled during dragging to keep it responsive.

Level Memory & Global Preference

  • Levels are remembered per “Provider + Model” based on your last explicitly selected reasoning effort.
  • Select “High” on a model, switch to another model and back—you’re still on “High.” Models you haven’t selected default to the catalog’s default value.
  • Memory is shared across all sessions: switching models, creating new sessions, or navigating to earlier-created sessions all maintain the same level.
  • Preferences are backed up via localStorage: when the Host route is unavailable (e.g., the desktop version’s /api prefix is intercepted by the framework and returns 401), the local cache ensures level memory and provider ordering persist after session switches and page refreshes.

Provider Sorting & Persistence

  • Each provider row has a small dot handle (⋮⋮) on the left. Hold and drag the handle to reorder.
  • Changes are committed only on release. Press Esc during dragging to cancel.
  • Dragging is only allowed via the handle. Clicking the provider row itself retains the original selection behavior.
  • Persistence location: $DSH_HOME/model-picker/state.json (default ~/.dsh/model-picker/state.json).
  • Read/write is handled by the Host side via same-origin loopback routes, with atomic writes. Persists across page refreshes, plugin reloads, and app restarts.
  • Old-format files are automatically migrated on read. Corrupted files are archived before being rebuilt.
  • When storage is unavailable, it silently degrades to “no memory” mode without affecting model selection itself.

Panel Resizing & Size Memory

  • Both columns of the panel can be resized by dragging their borders. Changes commit on release (real-time dimension readout shown during drag).
  • Drag the left border of the provider column: adjusts provider column width; the panel’s left edge follows the pointer.
  • Drag the left border of the model column (the boundary between columns): total width stays the same; adjusts the split between columns; the boundary follows the pointer.
  • Drag the top border of either column: both columns grow taller simultaneously; the dragged top edge follows the pointer (the opposite edge stays fixed).
  • Drag the top-left corner of the provider column: width and height change together.
  • Both columns always share the same height (a single height value rendered via flex stretch)—one column can never be taller than the other.
  • The pointer must remain still over the 5px hot zone for approximately 140ms before the resize cursor and guide line appear. Quick passes don’t change the cursor or accidentally trigger a drag.
  • Movement exceeding 3px after pressing counts as a drag. A simple click doesn’t change any dimensions.
  • The tooltip doesn’t disconnect on press: the pressed state directly takes over the armed state. The cursor and guide line remain continuously visible throughout the drag. After release, if the pointer is still within the hot zone, they stay visible. They retract only when the pointer leaves the hot zone or the panel is closed.
  • Dimensions have bounds: provider column 120–420px, model column 220–760px, height 180–660px. The panel also won’t be dragged outside the viewport.
  • After manually setting the height, the model list consumes the remaining height—no large blank areas left behind.
  • Sizes are stored in the layout field of state.json alongside other preferences (legacy files automatically get null filled in on read; existing ordering and level memory are preserved).
  • When storage is unavailable, it silently degrades to not remembering sizes.
  • Sizes are a global preference (shared across all sessions), not stored per session.
  • The read/write chain has three layers:
    1. Host state file (authoritative, persists across restarts): The Host side registers GET /api/dsh-model-picker/state and PUT .../state/save into the Fetch route table of the composition-layer connection service, while also retaining a set of webServer.register exact-match routes as fallback. Since connection may become ready after the plugin, ctx.inject(['connection']) is used to wait for it.
    2. Page-level cache (localStorage key dsh-model-picker/layout): Written at the instant of release. When the component remounts (session switch), the first frame renders directly from this cache—no flash of default dimensions. Still available on refresh when the Host is temporarily unavailable.
    3. Read priority: Use Host record if available; fall back to page-level cache only when the Host reports “no record.” A failed Host read triggers one lightweight retry; if that also fails, silently degrade.

Data & Backfill

  • Catalog: ctx.remote.session.modelCatalog()
  • Backfill: ctx.remote.session.selectModel({ sessionId, provider, model, reasoningEffort? })
  • Current selection: next ?? lastUsed from the session projection modelSelection, falling back to the catalog default.
  • Sub-sessions (addressed subagents) do not render this: consistent with the host’s built-in selector behavior.

Hover & Selection

  • Hover highlighting is state-driven (data-lit), not relying solely on :hover.
  • When the pointer enters a provider row on the left, that row’s text highlights immediately. When the pointer moves to the model list on the right, the provider row stays highlighted while the model row under the pointer also lights up.
  • When the pointer leaves the entire panel (including the gap between the two columns), all hover highlights extinguish together—no residual highlighting remains.
  • Highlighting only changes background color and text color. Row height, padding, and border width remain unchanged, so the list won’t jump or misalign. Both columns share the same rule and both maintain the pointer cursor.
  • Hover and selection use two distinct token families:
  • Hover: Business blue family (background --dsw-alias-state-business-tertiary + text --dsw-alias-state-business-primary; light theme: pale blue background + blue text, dark theme: deep blue background + bright blue text).
  • Selection: Neutral layer --dsw-alias-interactive-bg-active (light: rgba(38,49,72,.1), dark: rgba(255,255,255,.14)).
  • Both tokens are provided in light and dark values by the host. No new variables are introduced.
  • The hover rule explicitly excludes the currently selected row. When both conditions are met, the selected state takes precedence.
  • For the currently selected provider, in addition to the ✓ and persistent gray background on the left row, the trigger button always displays the provider and model name.

Seat Override

  • Seat: conversation.input.model, priority -200.
  • The host’s built-in implementation uses priority 0. A single seat renders only the one with the lowest priority, so this plugin overrides it.
  • When disabled, the host’s built-in selector automatically returns.

Installation & Enabling

In DSH, use the plugin manager to install from a local directory:

plugin_manager({ action: "install_bundle", target: "D:\\Documents\\deepseek-harness\\default-workspace\\dsh-plugins\\dsh-model-picker" })

After installation, reload the page to see the new selector. To disable:

plugin_manager({ action: "set_bundle", target: "@local/dsh-model-picker", enabled: false })

After disabling, the host’s built-in selector automatically returns.

Typical Usage

  1. After installing the plugin, a new model selection panel appears above the input toolbar.
  2. Hover over a provider row on the left to display that provider’s model list on the right.
  3. Move the mouse to the model list on the right—the provider row stays highlighted while the target model row also highlights.
  4. Click a model. The reasoning effort slider displays that model’s levels. Drag the slider to select a level; upon release, it automatically backfills to the session.
  5. The small dot handle on the left side of provider rows is for drag-to-reorder. Changes commit on release. Press Esc during dragging to cancel.

Applicable Scenarios & Notes

  • Ideal for agent developers who frequently switch models and adjust reasoning effort intensity, especially in multi-provider, multi-model scenarios.
  • The plugin runs with the current DSH process permissions. Review the source code and license before installing.

Closing

This plugin provides a more intuitive entry point for model switching in DSH through two-level model selection, a reasoning effort slider, and level memory. All functionality is based on the host’s model catalog with no hard-coded dependencies. Disabling it seamlessly restores the native selector. See the GitHub repository for more details.

References

  • GitHub: https://github.com/Zjb0702/dsh-model-picker
羽毛球分组比赛记分
小程序二维码

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

Xiaoye