편집자 노트

会话续跑

Status: Feature Plugin with Compatibility Patch. Tested only with DeepSeek Harness 0.1.0-rc.6.

이것은 DeepSeek Harness(DSH) 플러그인입니다. 이 사이트는 GitHub README, 설치 정보, 유지보수 상태, 공개 보안 시그널을 모아 보여줍니다.

업스트림에서 중국어 README를 제공하지 않아 저장소 원본 내용을 표시합니다.

dsh-resume

English | 中文

Status: Feature Plugin with Compatibility Patch. Tested only with DeepSeek Harness 0.1.0-rc.6.

dsh-resume adds two continuity behaviors to the DSH Web profile: an interrupted turn can continue from an empty submit without adding a visible "continue" message, and sessions that were still running when DSH stopped can be resumed after the next boot.

Problem

Upstream DSH can resume stored sessions and repair torn logs, but it does not treat an empty composer submission as continuation and does not automatically restart the exact set of sessions and subagents that were active at process shutdown.

Behavior

  • Folds received partial text and reasoning into session history when a turn is interrupted.
  • Enables empty-submit continuation for an interrupted conversation.
  • Tracks active top-level sessions and subagents in ~/.dsh/resume-state.json.
  • Restores only entries recorded as running at shutdown; completed or user-aborted turns are not restored.
  • Consumes the state file per session: each successfully resumed session is removed from the persisted set immediately (atomic write), so a crash or kill during restoration never loses the remaining sessions — the next boot continues with what is left. Failed resumes stay recorded and are retried on the next boot.
  • Automatically retries recorded subagents at startup; failed entries remain available through resume_interrupted_subagents.
  • Writes recovery diagnostics to ~/.dsh/resume-state.log.

Non-goals

This package does not import sessions from other agents, rewind arbitrary turns, migrate workspaces, guarantee that a remote provider can reproduce an interrupted stream byte-for-byte, or repair every upstream session-log race.

Mechanism

The host plugin listens to agent lifecycle events and uses the official agents.resume service. Compatibility patches add partial-turn folding and empty-submit handling to:

  • @deepseek-ai/dsh-agent-loop@0.1.0-rc.6
  • @deepseek-ai/dsh-session@0.1.0-rc.6
  • @deepseek-ai/dsh-client-ui-conversation@0.1.0-rc.6

Every target hunk is idempotent and has an explicit reverse operation. Version policy is adaptive by default: a copy whose installed version differs from 0.1.0-rc.6 is still patched when every hunk anchor matches uniquely (recorded as an adaptive match), and skipped with a reason when anchors drifted. The programmatic strict option restores the old exact-version-only apply behavior. One drifted copy never blocks the others, and patch application never throws during module loading, so an upstream upgrade cannot brick the agent loop. Restore remains strictly version-guarded in every mode.

Compatibility

Tested with DeepSeek Harness 0.1.0-rc.6, Node.js ^22.19.0 || >=24, and pnpm >=10. After an upstream upgrade, run dsh-resume-restore and verify:anchors once to confirm every hunk is either applied or intentionally skipped.

Install

dsh plugin --profile web add "github:xiaohj233/dsh-resume#v0.2.1"

Restart the Web profile. Startup applies the guarded compatibility patches before enabling resume behavior.

Configuration

Override the dsh-resume row in a later profile patch when needed:

- id: dsh-resume
  config:
    enabled: true
    restoreDelayMs: 2000

enabled controls startup restoration. Runtime tracking remains active so a later enabled boot can restore the recorded set.

Restore and uninstall

Restore official package files before removing the plugin:

pnpm --dir "$DSH_HOME/profiles/web" exec dsh-resume-restore
dsh plugin --profile web remove dsh-resume

When $DSH_HOME is unset the profile lives under the home directory (POSIX: ~/.dsh/profiles/web; Windows PowerShell: %USERPROFILE%\.dsh\profiles\web); on Windows pass the resolved path to pnpm --dir instead of ~. Normal Cordis shutdown does not reverse patches; shutdown is when continuity state must be preserved.

After uninstall, resume-state.json and resume-state.log are no longer read. Delete them manually if their session identifiers and diagnostics are no longer needed.

Safety and privacy

The state and log files contain session/subagent identifiers, model and recovery diagnostics, and failure messages. They do not intentionally store credential values, but they should be treated as private runtime data. Automatic restoration can issue new model requests and incur provider usage.

Tests

npm test
npm run check
npm pack --dry-run

The test suite covers exact version refusal, unique-anchor refusal, whole-run atomicity, idempotence, byte-exact patch/restore round trips, normal-shutdown behavior, and restore CLI failures.

Limitations and upstream status

Upstream already provides resumeSessionId, interrupted-turn closers, checkpoints, and session persistence. This package builds on those mechanisms and patches only the missing empty-continuation and shutdown-set restoration behavior. DSH Discussion #420 documents an upstream resume/closer sequence race that this package does not claim to eliminate.

License

MIT. Patch targets are MIT-licensed; see THIRD_PARTY_NOTICES.md.

REPOSITORY SIGNALS

보안 및 설치 증거

이 점수는 공개 저장소 메타데이터와 이 사이트에 등록된 설치 증거에만 기반하며, 코드 보안 감사와 다릅니다.

출처 추적 가능

공개 플러그인 카탈로그에서 왔으며, 공개 GitHub 저장소로 연결됩니다.

라이선스

저장소가 MIT 라이선스를 선언했습니다.

유지보수 활동

최근 180일 내 코드 업데이트가 있습니다.

설치 증거

재현 가능한 정확한 설치 메타데이터가 아직 등록되지 않았습니다. 저장소 설명에 따라 직접 확인하세요.

설치 라이프사이클 스크립트

검사한 패키지 메타데이터에 설치 라이프사이클 스크립트가 선언되지 않았습니다.