Introduction¶
The plugin architecture of DeepSeek Harness (DSH) allows developers to extend agent capabilities. When debugging or deploying agents, answers generated by the primary model may contain logical errors or omissions, requiring human intervention or review by a second-layer model. The dsh-second-opinion plugin provides an asynchronous second-model review mechanism for this purpose. It does not block or delay the primary model’s response; instead, it runs reviews in the background and provides an option to reconsider.
Core Features¶
The plugin is maintained by scwlkq and is open source under the MIT license. It primarily addresses the problem of validating the quality of agent responses and provides the following capabilities:
- Non-blocking review: Reviews each submitted assistant message without delaying or failing the primary turn.
- Concurrent and serial control: Runs reviews serially within a Session and in parallel across Sessions.
- Dual modes: Supports an advisory mode that only provides suggestions and a bounded automatic reconsideration mode that triggers the primary model to rethink.
- Precise citation anchoring: Anchors comments to the exact text cited in the conversation; if no citation is present, it retains general comments.
- State persistence: Persists pending, completed, and failed reviews in the Storage Domain sidecar.
- Web UI interaction: Exposes retry, per-comment reconsideration, and overall reconsideration features in the Web UI.
- Security isolation: The reviewer model does not have the primary agent’s tools and cannot execute tool side effects.
Installation and Activation¶
Installing the plugin requires the DeepSeek Harness Web profile. Use the official command to install the published npm package:
dsh plugin --profile web add dsh-second-opinion
After installation is complete, restart the DSH Web process to activate the plugin. The plugin loads both the Host plugin and browser contributions.
Usage¶
After installation, it enters the default advisory mode without additional configuration.
- Start DSH Web:
dsh --profile web. - Send a prompt and wait for the primary model response.
- Below the completed assistant message, locate and open the bubble action.
- The dialog first displays
Review pending, then displays the reviewer’s verdict and comments. - You can send one comment or the complete review result back to the primary agent to trigger reconsideration.
Configuring the Review Model¶
By default, the reviewer uses the provider and model that generated the target message. To review with a dedicated B model, set the following environment variables:
export DSH_REVIEW_PROVIDER='<provider-id>'
export DSH_REVIEW_MODEL='<model-id>'
dsh --profile web
The review behavior can be further adjusted by configuring cordis.patch.yml. The plugin reads the following environment variables:
| Environment Variable | Default Value | Description |
|---|---|---|
DSH_REVIEW_MODE |
advisory |
Selects advisory (display only) or auto (automatically triggers reconsideration). |
DSH_REVIEW_PROVIDER |
unset | Reviewer provider ID. Must be set together with DSH_REVIEW_MODEL. |
DSH_REVIEW_MODEL |
unset | Reviewer model ID. Must be set together with DSH_REVIEW_PROVIDER. |
Add a configuration example to cordis.patch.yml:
- id: second-opinion
config:
mode: advisory
provider: '<provider-id>'
model: '<model-id>'
reasoningEffort: high
maxTokens: 900
maxContextMessages: 20
autoRevisionsPerTurn: 1
reviewToolCalls: true
Behavior and Limitations¶
Understanding the plugin’s behavior is essential for correct use:
- Context limitations: The reviewer provider receives only the target answer and up to
maxContextMessagesrecent visible conversation messages (excluding hidden reasoning). - Request counting: Each reviewed assistant message adds one model request. In
automode, if the review result disagrees, one primary model request is also added. - Failure handling: Reviewer failure does not block, delay, or replace the primary answer. Invalid output becomes a failed review that users can manually retry.
- Tool isolation: The reviewer receives only a structured
submit_reviewresponse tool and cannot access the primary agent’s executable tools. - Automatic reconsideration limits: Limited by
autoRevisionsPerTurnand does not review the plugin’s own advisory chain to prevent infinite loops. - Session progress: If the Session advances before a slow review completes, the result remains available as advice but is not injected into new tasks.
- Streaming: Review starts after the assistant message is submitted, not during token streaming.
- UI limitations: Version
0.1.0only supports interactive review actions for the Web profile; precise citation anchors are displayed in the dialog but do not decorate or select the original conversation DOM.
Conclusion¶
dsh-second-opinion provides DeepSeek Harness with a controllable second-layer review mechanism. Through asynchronous execution and bounded automatic reconsideration, it improves answer quality without sacrificing the primary model’s response speed. The initial version is primarily adapted for the DSH Web profile.