Introduction¶
When running complex workflows in DeepSeek Harness (DSH), sessions can frequently get stuck: the model falls into a reasoning repetition loop, outputs only thinking content with no actual body text, or the reply is hidden at the UI level. These issues often require restarting the host to recover, disrupting the development flow.
DSH’s philosophy is “everything is a plugin.” This session reliability toolkit, dsh-session-rescue, is designed specifically to solve the problems above.
What It Is¶
dsh-session-rescue is a session reliability toolkit for DeepSeek Harness 0.2.x, maintained by MacilyDots. It detects two failure modes that cause sessions to hang: reasoning repetition loops and empty turns that contain only thinking with no body text. It records diagnostic evidence and creates a clean session for recovery.
Core Modules¶
The toolkit contains five modules, controlled by four toggles:
degen-guard: Detects token-level repetition in the reasoning channel, aborts the current step, and performs the configured recovery action. Enabled by default.llm-reasoning-retry: When upstream ends normally withend_turnbut the response contains only thinking with no body text or tool calls, it resends the same request once. Enabled by default.llm-wiretap: Writes the request body and the raw upstream SSE stream to local disk for troubleshooting. Disabled by default; enable only when collecting evidence.session-inherit: Mechanically extracts verifiable anchor points, creates a clean session, and injects a handoff document. Used via the/inheritcommand and thesession_inherittool. Enabled by default.- Frontend refresh:
Ctrl+Shift+Rreloads only the renderer process without restarting the host. Enabled by default.
The toolkit has a single profile entry point, with modules controlled via the guardEnabled, retryEnabled, inheritEnabled, and wiretapEnabled toggles. wiretap is disabled by default and should only be enabled when collecting diagnostic evidence. It sits outside the retry wrapper, so it records the post-retry response; the retry module retains its own empty-turn evidence internally.
Installation¶
Install with the following command:
dsh plugin --profile desktop add dsh-session-rescue
Restart DSH after installation.
Recovery After Circuit Breaker Trips¶
degen-guard trips its circuit breaker after multiple cumulative triggers within the same session. Use onFused to select the recovery action:
| Value | Behavior |
|---|---|
hint (default) |
Adds /inherit <sessionId> to the stop reason; does not create a session |
draft |
Creates a new session and writes the handoff document, but does not start the model |
auto |
Waits for the source agent to go quiescent, then starts a new session with constrained breakout instructions |
auto is bounded by maxAutoChain (default 1). After reaching the limit, a subsequent trip downgrades to draft. If the workspace or inherited preset cannot be validated, the same child session is downgraded to draft rather than rebuilt. Creation timeouts are not retried.
You can switch modes within the current session:
/degen-mode View the current effective value
/degen-mode auto Persistently switch to auto
/degen-mode draft Persistently switch to draft
/degen-mode hint Persistently switch to hint
The diagnostic endpoint returns effectiveOnFused and effectiveMaxAutoChain. Manually editing cordis.patch.yml takes effect without a restart, as these fields are volatile.
Body Text Not Displaying¶
If assistant replies are hidden and only restarting the host restores them, press Ctrl+Shift+R. It reloads only the renderer process; running agents, sessions, and tasks live in the host process and are unaffected. This is a quick-recovery entry point and does not prevent the underlying UI fault itself.
Local Data & Privacy¶
llm-wiretapwrites the request body and raw SSE to the log directory under DSH home. Credential headers are redacted, but the request body itself may contain task content. Keep it disabled outside of troubleshooting.degen-guardwrites handoff documents to the handoff directory under DSH home and reads session archives to extract anchor points.session-inheritreads session logs and writes the handoff document as the first message of the new session.
The toolkit itself does not upload these files.
Use Cases & Caveats¶
Suitable for use when developing complex workflows in a DSH 0.2.x environment, addressing scenarios such as session freezes, reasoning empty turns, and lost UI replies.
The plugin runs with the permissions of the current dsh process. Review the source code and license before installing.
Value & Links¶
This toolkit provides automatic detection and recovery paths when reasoning degrades, and a quick-refresh entry point for UI faults, reducing the frequency of manual host restarts.
- Plugin directory page: https://www.skillhub.cn/plugins/MacilyDots/dsh-session-rescue
- GitHub: https://github.com/MacilyDots/dsh-session-rescue