dshx-subagent-model-sync: Auto-Sync Subagent Model Whitelist

Preface

Selecting the subagent model in DeepSeek Harness (DSH) requires manually maintaining a provider/model list in the official settings. Every time a model is added or retired under a provider, this roster must be updated in sync. In multi-provider, multi-model environments, this list is prone to omissions or staleness, undermining consistency of the models available to subagents.

The dshx-subagent-model-sync plugin replaces this manual allowlist with automatic synchronization: select the allowed providers, and all models registered and enabled for that provider in DSH will automatically appear in the subagent’s selectable scope for new sessions. Manual entries are preserved; the plugin only manages entries it wrote itself.

What This Is

  • Name: dshx-subagent-model-sync
  • Maintainer: callaumyan-design
  • Category: Model Inference
  • Summary: Synchronizes the official subagent model allowlist from the live catalog of selected LLM providers. Once a provider is selected, its registered models are automatically added to the allowlist for new sessions. Manual entries are preserved; only plugin-managed entries are retracted.

Core Features

  • Sync model lists from provider catalogs: Reads ctx.llm.listModels() to obtain the exact provider/model list.
  • Merge into the official allowlist: Combines plugin-managed entries with user manual entries and writes them into allowedModels under subagent-model-selection-settings.
  • Manual entries are permanently preserved: Entries the user added in the official settings never enter the plugin’s shadow ledger and will not be retracted by the plugin.
  • Entry retraction conditions: Plugin-managed entries are retracted when the model leaves the catalog, is excluded by excludeModels, or the provider is deselected.
  • Failed catalog reads don’t empty the list: If a provider’s catalog temporarily fails to read, its entries are left as-is rather than treated as an empty catalog.
  • Idempotency and deduplication: Repeated syncs or concurrent triggers converge; no config write occurs if the roster content is unchanged.
  • Official-channel writes: Uses ctx.settings.update() (dsh-settings) → configEditor.edit() — hot reload + atomic write + rollback on failure. The plugin does not directly modify profile YAML files, does not touch the official settings enabled toggle, and does not read keys.

How It Works

Select providers → read catalog (exact provider/model) → merge with official manual entries → generate new roster → write config via the official channel.

Manual entries are never lost and never enter the plugin’s shadow ledger. The plugin only retracts entries it wrote itself.

Trigger Points

  • Plugin load / config change (HMR)
  • llm/adapters-updated: provider registry changes (provider added/removed)
  • app-boot/config-reload: after any profile config write (e.g., adding/removing models in provider settings)
  • Manual command /subagent-model-sync

When It Takes Effect

The official implementation samples the config at the creation of a new top-level session (agent/created) and writes it into subagent/model-selection-policy, which child sessions inherit. Therefore:

  • After a sync completes, newly created conversations pick up the new roster.
  • Existing sessions are not backfilled; they retain the roster from creation time. Create a new conversation to verify.
  • “Sync successful” does not mean routing is established: when a subagent actually invokes the model, it still goes through DSH’s account, model availability, and billing checks.

There is a brief event-driven window between a catalog change and the plugin finishing its sync. If timing is critical, run /subagent-model-sync manually for immediate synchronization.

Installation & Activation

DSH must be fully quit before installation (tray → Quit):

node install-profile.mjs          # or --dry-run to preview what will change

By default, the mount entry is pre-filled with enabled: true + providers: [openai], so it’s ready to use right after install. Add --no-preset to only mount the plugin and enable it in settings afterward.

After DSH starts, the plugin completes its first sync automatically at load time. Because startup load ordering is non-deterministic, two layers of self-healing exist: if the official settings entry is not yet ready, it auto-retries (up to 3 times); the provider registration completion event (llm/adapters-updated) also triggers another sync. You can also run /subagent-model-sync manually for immediate sync and to view details.

Quit DSH before uninstalling as well:

node uninstall-profile.mjs

By default, entries the plugin wrote into the official allowlist are preserved (they become ordinary manual entries after uninstall). To remove them completely: first clear providers in the plugin settings (or run /subagent-model-sync before toggling off enabled), let the plugin retract all its managed entries, then uninstall.

Configuration

All fields are volatile and editable in the DSH settings page.

Field Description
enabled Master switch for the plugin. Off = stop managing (does not retract existing entries)
providers List of selected provider ids, e.g., ["openai"]. Uses internal ids, not display names
excludeModels Exact-route blacklist: use this to exclude specific models without deselecting the entire provider
managedRoutes Shadow ledger (which entries the plugin has written). Auto-maintained; do not edit manually

Commands

/subagent-model-sync

Performs an immediate sync. Output includes: added/retracted details, roster count, warnings (catalog failure, official toggle status, empty-list notice), and a note on when it takes effect.

Use Cases & Caveats

  • Suitable for DSH users who need to keep subagent model lists consistent across multiple providers.
  • The plugin runs with the current DSH process’s permissions. It is recommended to review the source code and license before installation.

In Short

Replaces manual maintenance of the subagent model allowlist with per-provider automatic synchronization, reducing omissions and staleness. Quit DSH before installing; use node install-profile.mjs to install. See GitHub for more details.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye