deepseek-harness/examples
Yichen Jiang 7e95a00c8a fix(llm): align replay state with assembled content and degrade unusable state
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.
2026-08-15 16:07:30 +08:00
..
acp-agent fix(llm): align replay state with assembled content and degrade unusable state 2026-08-15 16:07:30 +08:00
headless-agent Merge pull request #2374 from deepseek-harness/codex/product-subagent-one-shot-background 2026-08-14 15:49:58 +08:00
jsonrpc-agent Merge remote-tracking branch 'origin/master' into worktree/minimal-no-runtime-context 2026-08-13 10:24:29 +08:00
mcp-memory docs(i18n): include complete proofreading corpus 2026-08-12 12:30:19 +08:00
web-cordis • feat(self-modification): add dynamic Cordis plugin runtime and UI 2026-08-13 01:29:36 +08:00
web-schedule refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
AGENTS.md docs: make technical prose concrete 2026-08-10 16:34:20 +08:00
CLAUDE.md refactor(examples): extract reusable logic into tested packages 2026-06-19 12:42:28 +08:00
package.json • feat(self-modification): add dynamic Cordis plugin runtime and UI 2026-08-13 01:29:36 +08:00
README.i18n.yaml docs(i18n): apply reviewed Chinese proofreading updates 2026-08-12 09:59:19 +08:00
README.md refactor(schedule): keep reminder delivery conversational 2026-08-09 15:22:53 +08:00
README.zh.md docs(i18n): apply reviewed Chinese proofreading updates 2026-08-12 09:59:19 +08:00

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.