A turn cancelled mid-stream dropped everything the interrupted step had streamed: chunks stayed in the log for replay, but no assistant/message joined the surface, so the next request carried nothing the user had watched stream. Follow-ups after cancel could not connect and forks inherited the gap. Keep the streaming attempt alive across the step's request loop and, when an abort escapes with the attempt uncommitted, finalize its user-visible prefix as the step's ordinary assistant/message citing the logged chunk seqs. BlockAssembler.interruptedBlocks() owns the safe subset next to the max-tokens rule: closed and open text/reasoning blocks with content, in stream order; tool calls, empty blocks, and unknown open blocks drop. Retry clears the attempt first, so an abort after llm/retry finalizes nothing from the reset stream. Tool-phase cancellation and provider failures keep their existing shapes.
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.
acp-agent
An Agent Client Protocol automation server for programmatic clients, with session, permission, and cancellation support. See the ACP example reference.