A max-tokens response that included a tool call persisted assembler-transformed content next to replay metadata projected from the untransformed native message, so the next request died in history reconstruction with INVALID_REPLAY_STATE and the session stayed permanently stuck. Write side: the finish chunk's replayState becomes a typed ReplayEnvelope — opaque response-level metadata plus optional per-block entries aligned with the emitted block sequence. BlockAssembler computes one keep/drop decision for blocks and entries together, so stored metadata always describes stored content and retained blocks keep their signatures. pi-ai splits its state into a version-2 response half and per-block signature entries. Read side: durable content is authoritative. toPiAssistant degrades any unusable state — foreign kind, other versions (including the flat v1 form already on disk), malformed metadata, or content/block mismatches — to the existing provider-neutral conversion with an onReplayDegrade diagnostic instead of failing the request, which un-bricks sessions poisoned before this change. Covered by assembler and replay unit tests, an agent-loop continuation regression, keyless real-composition continuation tests (native pruned-envelope replay and legacy flat-state degrade), and the authored keyless snapshot scenario max-tokens-continue through the assembled ACP app.
Examples
English | 中文
Runnable demonstrations of the main DeepSeek Harness interfaces and extension points. Each child directory owns its configuration, prerequisites, commands, and detailed behavior.
mcp-memory
Optional overlays that connect supported third-party memory servers through the generic MCP client. See the memory example reference.
headless-agent
A non-interactive agent that accepts one task, runs it, and emits a selected machine-readable or human-readable output format. See the headless example reference.
jsonrpc-agent
An unattended coding agent driven through the Python SDK and JSON-RPC. See the JSON-RPC example reference.
web-cordis
A self-referential agent that can inspect and change its in-memory Cordis plugin tree. See the web-cordis example reference.
web-schedule
An opt-in Web overlay for durable, Session-local reminders. It supports positive whole-second after_seconds delays and absolute at targets through schedule_create, schedule_list, and schedule_delete; active reminders persist in the original Session, resume when that Session becomes live again, and do not run while it is cold. Run dsh web --patch examples/web-schedule/cordis.yml; see web-schedule/README.md for absolute-time authority, delivery, and recovery boundaries.
acp-agent
An Agent Client Protocol automation server for programmatic clients, with session, permission, and cancellation support. See the ACP example reference.