AI Agent Hub
Back to plugins
🤖

dsh-llm-finish-reason-tolerance

Model Inference Updated 2026.08.25

Run the following command in DeepSeek Harness:

dsh plugin install michael-han-il/dsh-llm-finish-reason-tolerance

Paste the following prompt into your AI chat to install this plugin:

To install this plugin in DeepSeek Harness, run `dsh plugin install michael-han-il/dsh-llm-finish-reason-tolerance` referencing the source code at https://github.com/michael-han-il/dsh-llm-finish-reason-tolerance.

About this plugin

When integrating DeepSeek Harness with certain OpenAI-compatible providers like Snowflake Cortex, developers often encounter a tricky compatibility issue. These services correctly send data: [DONE] during streaming but fail to include the standard finish_reason field in their response. Consequently, the Harness model client misinterprets this as a stream truncation error, terminating the entire conversational turn despite the actual content being fully received.

The dsh-llm-finish-reason-tolerance plugin is designed specifically to resolve this pain point. Acting as a global listener within Harness, it precisely intercepts and rewrites the specific stream termination error. By intelligently determining the type of content delivered, it transforms the original "transport failure" into a legitimate "successful finish" state, ensuring the Agent can naturally conclude its current turn without interruption caused by a missing metadata field.

This plugin is ideal for developers building on DeepSeek Harness who need to support providers like Snowflake Cortex or similar implementations. It requires no modification of underlying code and works seamlessly upon installation and restart, significantly enhancing Harness's compatibility and robustness towards non-standard OpenAI API behaviors.

Use Cases

  • Integrating Snowflake Cortex model gateway
  • Resolving missing finish_reason in streaming responses
  • Ensuring DeepSeek Harness compatibility with non-standard APIs

Best For

  • AI developers using DeepSeek Harness
  • Architects integrating complex LLM gateways
  • DevOps engineers handling non-standard API responses