JayYuen666/dsh-session-rescue

Removes the manual chore when a turn ends badly through three automatic injections: resume after a transient failure, continue after output truncation, and re-run after an unfinished todo list, plus a request-level 429 backstop that only takes over when the host resolved no retryPolicy. The client half docks below the input box with edit-resend, fork-resend, withdraw-and-edit, manual retry and a countdown banner; permanent failures (auth, context-window) are intentionally left alone.

@jayyuen66/dsh-session-rescue removes the manual chore when a turn ends badly, via three automatic injections: resume after a transient failure, continue after output truncation, and re-run after an unfinished todo list. Transient failures are judged by a classifier that recognizes RATE_LIMIT / SERVER / TIMEOUT / TRANSPORT / EMPTY_RESPONSE, HTTP 429 and 5xx, and quota/empty-response wording; continue fires when a turn ends idle with reason.kind === "max-tokens", and unfinished fires when that turn's own todo/write snapshot still holds non-completed items (a purely structured signal, no text guessing). Each kind has its own delay, cooldown and quota gates, and every injection is a role: "user" message sourced as plugin:session-rescue. There is also a request-level 429 backstop on agent/request-error that only takes over when the host resolved no retryPolicy for that provider — otherwise the official llm-retry owns it and this plugin steps aside — with a 2s/5s/10s/20s/30s ladder and at most 5 retries per session, honoring a provider Retry-After over the ladder. Permanent failures (CONTEXT_WINDOW_EXCEEDED, AUTH, INVALID_*, HTTP 401/403), exhausted-balance wording, non-root sessions, and turns the user stopped (aborted/interrupted) are deliberately left alone, as are turns that called ask_user_question or were goal/schedule-driven. The client half docks below the input box with edit-resend, fork-resend, withdraw-and-edit, stop-and-re-ask, manual retry and a countdown banner, using a self-scheduling two-tier poll (1s while pending, 5s otherwise).

Sessions & Messages ★ 0 updated 2026-10-11
View on GitHub ↗

Install

dsh plugin --profile web add @jayyuen66/dsh-session-rescue

Copied verbatim from the README's Install block. The packages are on the public npm registry, so installation needs no credentials; remove with dsh plugin --profile web remove @jayyuen66/dsh-session-rescue.

Compatibility

Requires dsh >= 0.2.1-alpha.2 (the source of truth is the @deepseek-ai/dsh entry under peerDependencies). The host half hard-depends on timer and settings; webServer is required through a child fiber, so a host without webServer (TUI) keeps auto-resume working and simply never gets the six routes. The package's own cordis.patch.yml, pointed at by dsh.bundle.patch, registers the loader row via dsh plugin add.

Details

Alternatives

beijingwahw/dsh-companion · caoqinnan-web/organize-workspace-sessions · Cerbur/clutch-dsh

More plugins in Sessions & Messages

Browse more in Sessions & Messages

Guides for Sessions & Messages plugins