All plugins

DSH / BUNDLE / BUNDLES

dsh-session-rescue

v0.2.01622352030 / dsh-session-rescue71c133d435

InstallableBundlesBundles & other modulesCommunity · Topic auto-analysis

Overview

dsh-session-rescue

Prevents the DeepSeek Harness cold-start turn stall: after a restart or session load the first turn can block forever while the token meter synchronously replays the whole session log; this plugin compacts the session before its size reaches that danger zone, so the replay stays cheap.

README / EN

Package documentation

Registry summary

Prevents the DeepSeek Harness cold-start turn stall: after a restart or session load the first turn can block forever while the token meter synchronously replays the whole session log; this plugin compacts the session before its size reaches that danger zone, so the replay stays cheap.

dsh.pub verifies the pinned bundle contract, runtime facts, and distribution semantics. The complete README remains in the source repository.

Read the full README on GitHub

LIMITATIONS

Known limitations

- **Verified in an isolated `DSH_HOME`, not end-to-end against the stall.** A real headless Harness run loaded the plugin, fired its `agent/status` hook, resolved `ctx.get('compaction')`, and opened a real compaction transaction (`compaction/start` carrying `sourceCommandId: "session-rescue-guard-1"`) — reproduced twice. The stall itself was **not** reproduced, and the "compact before the first turn" ordering is covered by unit tests only. See `docs/DESIGN.md` → *Verification performed*. - **The size threshold is a proxy.** What actually costs time is the replay's per-event work, which cannot be measured from outside without paying for it. `seq` is the driver of the loop and is free to read, so it is used as the proxy — calibrated, not derived. - **One link is unproven.** Compaction demonstrably made the next cold start cheap in all three observed episodes (never-returning → 1.6–10 s), but *why* is not established: it cannot be by shortening the replay, since `seq` does not shrink. The plugin relies on the measured effect, and `docs/DESIGN.md` records the question as open. - **Compaction costs an LLM call** (15–20 s on the observed 300 k-token sessions) and rewrites history into a summary. That is a real change to your conversation, by design — the same operation `/compact` performs. Set `enabled: false` for report-only mode. - The earlier v0.1 approach (detect a stalled turn → cancel → cold rebuild) has been **removed**: the stall is a synchronous CPU loop, so `signal.throwIfAborted()` never gets a chance to run and cancellation cannot interrupt it.