Introduction¶
The built-in opencode-go route of DeepSeek Harness (DSH) relies on a static catalog within @earendil-works/pi-ai and does not update automatically. When the upstream dependency is not updated, new models (such as Step 5 or Cat Jam) will not appear in the model selector.
The dsh-opencode-go-catalog plugin solves this problem by maintaining three protocol-separated sibling routes. It never touches the built-in opencode-go route but manages the three routes opencode-go-extras, opencode-go-responses, and opencode-go-messages via the settings.mutate interface. The model list is rebuilt from the live roster and docs interface without manual intervention.
Core Features¶
- Real-time Catalog Maintenance: Fetches the latest status from
https://models.opencode.ai/api.json(registry) andhttps://opencode.ai/zen/go/v1/models(roster). - Protocol-Separated Routes: Divides models into three categories by protocol to avoid 500 or 401 errors caused by protocol mismatches.
opencode-go-extras: Uses theopenai-completionsprotocol.opencode-go-responses: Uses theopenai-responsesprotocol.opencode-go-messages: Uses theanthropic-messagesprotocol.
- Auto-sync and Snapshots: Supports the
/opencode-go-synccommand for forced synchronization and retains a curated snapshot as an offline fallback. - Fault Tolerance: Automatically switches to snapshot mode when source data is unavailable or the number of models falls below a safety threshold, ensuring the model selector is never left empty.
Installation and Activation¶
This plugin requires manual installation.
- Copy the plugin folder to the DSH configuration directory:
cp -r dsh-opencode-go-catalog <profile>/node_modules/dsh-opencode-go-catalog
- Edit the
package.jsonin the configuration directory and add the plugin name todsh.profile.bundles:
{
"dsh": {
"profile": {
"bundles": [
"dsh-opencode-go-catalog"
]
}
}
}
- Restart DSH.
Configuration Instructions¶
Configure the plugin in cordis.patch.yml to control synchronization behavior and route lists. This is a whole replacement (not a deep merge), so all fields must be included:
- id: opencode-go-catalog
name: dsh-opencode-go-catalog
config:
enabled: true # Removes sibling routes if false
autoMembership: true # If false, only uses snapshot, does not query roster/docs
minAutoModels: 8 # Safety threshold: use snapshot if below this number
minProtocolRows: 10 # Safety threshold: prevents empty routes due to docs redesign
minAutoRatio: 0.6 # Safety threshold: retention ratio of the last adopted set, 0 disables
refreshReasoning: true # If false, only uses snapshot reasoning values, disables auto mode
sessionHeaderValue: 'dsh-opencode-go-catalog' # Adds a static session header
intervalMinutes: 240 # 0 means sync only at startup
startupDelaySeconds: 10
refreshTimeoutMs: 120000
catalogPath: ./catalog/models.json
managedRoutes:
- opencode-go-extras
- opencode-go-responses
- opencode-go-messages
Common Commands and Scripts¶
Manage the catalog status via chat commands or script files.
Chat Commands
* /opencode-go-sync: Rewrite the model list immediately from live sources.
Script Files
* node bin/sync.mjs: Default mode, reports field differences, new/dead model IDs, but does not write to the file.
* node bin/sync.mjs --auto: Preview output in auto mode (additions, removals, unresolved items).
* node bin/sync.mjs --adopt: Write live members to the snapshot (preserving the current fallback snapshot).
* node bin/sync.mjs --write: Rewrite snapshot fields from the registry and mark the date.
Notes¶
- Manually Added Models are Not Persistent: Models added manually to the three routes in the settings interface will be overwritten or deleted during the next sync (startup, scheduled, or command-triggered). For persistence, use the
--adoptcommand to write to the snapshot or use an exclusion list. - Runtime Environment: The plugin runs with the permissions of the current DSH process. Please check the source code and license (MIT) before installation.
- Dependency Requirements: Ensure DSH is running and a valid
OPENCODE_GO_API_KEYis configured (availability of the built-in route indicates correct configuration).
Summary¶
dsh-opencode-go-catalog provides dynamic OpenCode Go model catalog management capabilities for DSH, solving the pain point of the built-in static catalog’s inability to update. Through protocol separation and snapshot fallback mechanisms, it ensures the real-time nature and stability of the model list without interfering with existing routes. The plugin source code and documentation are available on GitHub.