Introduction

OpenCode Go requires code to handle two critical features not provided by the shared pi-ai adapter: session identity and a real-time model catalog. This plugin provides the opencode-go route, which handles the Wire protocol for each model, maps session IDs into headers, and refreshes the model list to include newly released models.

Core Features

This plugin acts as the first-level OpenCode Go model provider in DeepSeek Harness. It implements the following:

  • Session identity: Maps GenerateOptions.sessionId to the x-opencode-session and x-deepseek-harness-session-id headers to satisfy the Go client matrix’s requirement for stable session IDs.
  • Real-time catalog: Refreshes the model list from {apiRoot}/v1/models, merges new IDs, and enriches model information so models released today can be selected immediately.
  • Web settings card: Provides a card at the bottom of the “Settings → Models” page for managing API keys, endpoints, and refresh intervals.

Installation and Enablement

This plugin requires DeepSeek Harness 0.2.0-rc.2 or later. Installing from GitHub does not require a build step.

  1. Run the installation command:
    dsh plugin --profile web add github:scavanger2221/dsh-llm-opencode-go#v0.1.4
  1. Start the Web interface:
    dsh web

To install from a local checkout, run:

git clone https://github.com/scavanger2221/dsh-llm-opencode-go
cd dsh-llm-opencode-go
./scripts/install-local.sh
dsh web

Configuration and Usage

Configuration is performed through the “Settings → Models” card in the Web interface. The API key is stored under OPENCODE_GO_API_KEY through the Harness credential service.

  • Edit endpoint and refresh: Directly edit the API root and refresh interval (default: 21600000 milliseconds) in the card.
  • Model overrides: When editing an individual model, each field defaults to “Inherit”. For example, changing the context window to 256K does not change the protocol or reasoning flags.
  • Disable/enable models: Disabling removes the model from the catalog but retains its description. Refreshing the catalog does not re-enable disabled models.
  • Input restrictions: If a model does not list images, prompts containing images are rejected.

Notes

  • Configuration file change: In version 0.1.7, there is no settings.yaml file to edit. Configuration is persisted in the config file through the config: override in cordis.patch.yml.
  • Enforced inputs: The plugin enforces input type checks and rejects requests containing images if the model does not list images.
  • Dependency version: Ensure the installed DeepSeek Harness version is 0.2.0-rc.2 or later.

This plugin provides OpenCode Go with complete session management and real-time model discovery capabilities, making it suitable for scenarios that require stable conversational routing and staying up to date with model releases. For more details and source code, visit the GitHub repository.