2nd dokployH
Find a file
Tianyi Cui d5e894edf4 fix(sdk): harden runtime lifecycle and JSON-RPC
Keep DeepSeekHarness.run() reusable, but make ownership of its lazy
runtime process explicit. Document the context-manager/close contract and
update every construction example to use a context manager so repeated runs
remain valid without encouraging leaked subprocesses.

Contain notification predicate failures at the subscription boundary. Remove
only the subscriber whose callback raised, deliver that exception through its
queue, and continue dispatching to healthy subscribers so arbitrary callback
code cannot terminate the shared reader thread or strand later requests.

Enforce one in-flight prompt per server session with an atomic activePrompt
guard. Route overlap through the existing -32603 handler-error response and
clear the guard in finally, preserving parallel prompts across sessions and
sequential reuse without changing JSON-RPC request or notification shapes.

Use StringDecoder for line framing so a UTF-8 code point split across Buffer
chunks is not corrupted. Add a queued-write flush barrier, and make memoized
shutdown await it before disposal and exit while retaining exactly-once
cleanup when shutdown calls race or flushing fails.

Cover callback isolation, same-session exclusion, cross-session concurrency,
split multibyte input, delayed writes, racing shutdown, and flush failure with
deterministic tests.
2026-07-13 21:40:12 +08:00
.agents/skills docs(rfc): align scoped runtime contracts 2026-07-12 22:49:46 +08:00
.claude docs: accuracy sweep, architecture restructure, two ADRs, review skill 2026-06-13 22:05:34 +08:00
.github/workflows python: derive release version from repository 2026-07-13 17:49:01 +08:00
docs python: derive release version from repository 2026-07-13 17:49:01 +08:00
examples refactor(core): remove owner-final assembly machinery 2026-07-13 13:09:41 +08:00
packages fix(sdk): harden runtime lifecycle and JSON-RPC 2026-07-13 21:40:12 +08:00
python fix(sdk): harden runtime lifecycle and JSON-RPC 2026-07-13 21:40:12 +08:00
scripts python: derive release version from repository 2026-07-13 17:49:01 +08:00
vendor fix(scope): harden lifecycle ownership foundation 2026-07-12 08:57:05 +08:00
.gitignore single-exe: closure manifest, build pipeline, and CI workflow 2026-07-13 15:50:09 +08:00
.gitlab-ci.yml python: derive release version from repository 2026-07-13 17:49:01 +08:00
AGENTS.md docs: fold the SDK serving surface into the repo maps 2026-07-13 15:50:09 +08:00
CLAUDE.md Initialize repo with README, AGENTS.md, and CLAUDE.md symlink 2026-06-10 22:58:56 +08:00
eslint.config.mjs chore(lint): one shared project service; ignore harness-local .claude state 2026-07-10 22:13:40 +08:00
knip.json single-exe: closure manifest, build pipeline, and CI workflow 2026-07-13 15:50:09 +08:00
lefthook.yml Merge parallel pre-push gates into CI scheduler 2026-07-06 01:47:13 +08:00
LICENSE Initialize repo with README, AGENTS.md, and CLAUDE.md symlink 2026-06-10 22:58:56 +08:00
package.json python: close runtime packaging and platform wheels 2026-07-13 16:34:09 +08:00
pnpm-lock.yaml python: close runtime packaging and platform wheels 2026-07-13 16:34:09 +08:00
pnpm-workspace.yaml single-exe: closure manifest, build pipeline, and CI workflow 2026-07-13 15:50:09 +08:00
pytest.ini python: deepseek-harness SDK and runtime carrier packages 2026-07-13 15:50:09 +08:00
README.i18n.yaml docs: revise graph docs from review 2026-07-05 01:25:58 +08:00
README.md docs: revise graph docs from review 2026-07-05 01:25:58 +08:00
README.zh.md docs: revise graph docs from review 2026-07-05 01:25:58 +08:00
tsconfig.base.json Merge remote-tracking branch 'origin/master' into codex/skill-system 2026-07-11 22:31:28 +08:00
tsconfig.build.json jsonrpc: SDK serving surface as plugins (dsh-jsonrpc + dsh-jsonrpc-agent) 2026-07-13 15:50:09 +08:00
tsconfig.json jsonrpc: SDK serving surface as plugins (dsh-jsonrpc + dsh-jsonrpc-agent) 2026-07-13 15:50:09 +08:00
tsdown.config.ts feat(sandbox): the confinement seam and the per-platform native runner chains 2026-07-10 15:43:02 +08:00
vitest.config.ts feat: add the worker-thread code runtime (dsh-code-runtime-worker) 2026-07-08 11:07:14 +08:00
vitest.e2e.config.ts Merge parallel pre-push gates into CI scheduler 2026-07-06 01:47:13 +08:00
vitest.snapshot.config.ts Add keyless snapshot refresh mode 2026-07-10 00:48:27 +08:00

DeepSeek Harness

English | 中文

The DeepSeek Harness SDK is a plugin-based SDK for building agent harnesses.

Development

This monorepo is built on the Cordis framework (vendored as source under vendor/), microkernel-style: everything is a plugin.

pnpm install
pnpm run test          # vitest
pnpm run demo:repl     # REPL agent demo (needs DEEPSEEK_API_KEY)
pnpm run demo:acp      # ACP server agent demo (needs DEEPSEEK_API_KEY)

For humans, start with the development guide for local setup, hooks, environment variables, and quality gates, then read the architecture design and documentation graph index before package work. Local context lives in packages/ and vendor/.

For agents, follow AGENTS.md.