Files
deepseek-harness/packages
Tianyi Cui 8fd7ff69e3 fix(sdk): reject unrepresented session activity failures
A summary can fail while appending turn/start or turn/end and still leave
the root idle with a stable Session sequence. The SDK wait operation then
returned {}, letting the external provider treat the preceding completed
terminal as the result of the entire task. A listener installed only for
the wait would also miss failures between prompt admission and the wait
request.

Retain one latest live failure on each existing SDK Session record, scoped
to the exact owned Agent. Record the Session's next log offset when the
failure occurs. A turn/end from the exact owned Session clears it only
when that terminal was committed at or after that offset. This preserves
failures raised during terminal publication, keeps ordinary represented
turn errors in the durable outcome, and permits later successful activity
to recover. At stable root/descendant completion, session/wait rejects any
remaining failure. Raw session.status and HarnessSession.run behavior are
unchanged; no generic failure history or new notification is introduced.

Add seven owner-local cases for later start/end failures before and during
wait, subsequent successful prompts, represented errors, and publication
ordering including an undefined thrown value. Six failure cases returned
success before the fix. Strengthen listener teardown coverage to assert
all actual subscriptions are disposed after a disposer fails.

Extend the existing recorded subagent-continuable SDK scenario to exercise
session/wait. It still asserts that run() returns DONE at parent turn 1,
then requires child completion and parent turn 2/idle plus its final
summary to be delivered before the wait response. Bypassing the wait made
that ordering assertion fail. No recorded Session or golden output was
invented or refreshed. Update the protocol/server bilingual READMEs and
regenerate the event-consumer matrix for the new error listener.

Validation:
- pnpm exec vitest run packages/sdk/server/tests/wait.spec.ts before the fix:
  6 failed, 1 passed (the represented-error case)
- pnpm exec vitest run packages/sdk/server/tests/server.spec.ts packages/sdk/server/tests/wait.spec.ts (40 passed)
- pnpm run test:e2e packages/subagent/subagent-dsh-sdk/tests/nested-delegation.e2e.ts packages/subagent/subagent-dsh-sdk/tests/loader-composition.e2e.ts (8 passed)
- DSH_EXAMPLE_MODE=lib pnpm run test:e2e packages/subagent/subagent-dsh-sdk/tests/nested-delegation.e2e.ts packages/subagent/subagent-dsh-sdk/tests/loader-composition.e2e.ts (8 passed)
- pnpm run test:snapshot snapshots/sdk/sdk.snapshot.ts -t 'replays subagent-continuable through dsh --profile sdk' (1 passed, 24 unselected)
- pnpm run doc-sync: Host compile/bundle, doc-typecheck and 40 other gates
  passed; the generated event graph was stale, then regenerated and passed
  pnpm run verify-doc-graphs (all 7 graph docs current)
- pnpm run lint:contracts-ready and focused lint of all changed SDK code
- named translation pairing checks and git diff --check

Independent SDK rereview and 7/7 focused tests found no remaining issue.
The parent task owns unchanged Python advanced/recovery validation on the
combined branch; this commit changes no Python or high-level SDK results.
2026-10-06 01:03:30 +08:00
..
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
2026-10-03 10:46:11 +08:00
…

description, kind
description kind
The DeepSeek Harness package workspace: how the npm packages under packages/ are grouped, what each group owns, and the conventions that bind them. package-group

Packages

English | 中文

Summary

The harness is assembled from npm packages under packages/, grouped by capability family: sessions and the agent loop, model-facing tools, shell and filesystem execution, web access, subagents, and the rest. Use this page as the top-level map: find the owning group, then open its README for the package list. Every package is scoped @deepseek-ai/dsh-* and lives in exactly one group; each group README is the authoritative package map for its family.

Table of Contents


Package groups

Every package lives in exactly one group; new packages join existing groups, and a new group updates its own README and this table.

Group Role
core/ Product API spine: sessions, prompts, tools, agent services, and the concrete loop
api/ Remote BFF assembly and Typert RPC gateway
typert/ Type graph generation, artifact loading, and runtime registry
goal/ Same-session goal persistence and lifecycle
schedule/ Host-owned scheduled follow-ups
feedback/ Human feedback capture and command
telemetry/ Shared Cordis OTel reporting channels
identity/ Shared anonymous identity
llm/ LLM capability family: abstract service + provider adapters
subprocess/ Subprocess capability family: Service Definition + local process-tree provider
ssh/ POSIX remote connection with paired filesystem, subprocess and sandbox providers
shell/ Bash capability family: executor seam, local impl, model-facing tools
terminal/ Persistent PTY capability family: owner-scoped sessions, local implementation, model-facing tools
ptc-runtime/ PTC execution capability family: Service Definition + sandboxed Node provider + PTC mode Consumer
computer-use/ Exclusive named desktop-provider registration
browser-use/ Exclusive named browser-provider registration
sandbox/ Process-confinement seam; bwrap/Landlock/Seatbelt backends
deliverables/ Turn deliverables: explicit file delivery and recorded workspace changes
fs/ Filesystem capability family: seam, local impl, model-facing file tools, discovery tools
lsp/ LSP capability family: seam, generic stdio provider, and the lsp tool
skill/ Skill capability family: provider registry, local provider, model-facing catalog/loader
compaction/ Compaction capability family: Service Definition + basic provider + command Consumer
context/ Model-visible request context: workspace instructions, time context, references
subagent/ Subagent capability family: provider-registry contract and model-facing delegation tools
jobs/ Generic background-job runtime and model-facing job control tools
experimental/ Pre-stable prototypes with explicit private exceptions
workflow/ Workflow seam, PTC process engine, and model-facing workflow/ralph tools
webhook/ Verified external events, trusted rules, and fire-and-forget Workspace Sessions
web/ Web capability family: seam, search/fetch providers, model-facing web tools
document/ Shared Host Office-to-PDF conversion
attachment/ Durable attachment identity, validation, local content-addressed storage
spill/ Spill capability family: storage seam, local impl, tool-result spill policy
todo/ The model-facing todo_write tool
plan/ Plan collaboration state with a direct entry command and reviewed exit
preset/ Per-session agent composition from preset cordis.yml files
guard/ Loop-hygiene guards: advisory repeat-call reminders + the tools/execute deadline enforcer
bundle/ Installable dsh --profile patch layers
extensions/ Agent runtime self-modification: live plugin/service inspection and model-written mount/unmount
mcp/ External Model Context Protocol servers exposed as native tools
hooks/ Hook bridges + the shared Claude Code / Codex wire-protocol library
session/ Durable session data plane: persistence seam + backends, projection seam, log-backed titles, session reporting
session-query/ Session retrieval family: logical corpus, bounded reads, lineage, semantic filtering, SQLite full-text search
settings/ User-settings seam + file-backed provider
credentials/ Credential-reference and credential-record seam + env-over-.env provider + authorization flows that ask a human
storage/ Non-session storage hub + backends + domain form
workspace/ Workspace entity
sdk/ Out-of-process SDK: JSON-RPC protocol and TypeScript client/server
acp/ Automation-only Agent Client Protocol server
interaction/ Human-collaboration plane: approval/interaction seams, permission preset, commands, ask-user tool
boot/ Shared app-bin boot glue
host/ Web GUI host services, directory picking, application launch, plugin inventory, and product telemetry
client/ Web-GUI browser half: shell, wire, object services, slots, ui-* plugins
test-support/ Test infrastructure (testkits, replay, Loader smokes)
util/ Low-level zero-dependency utilities shared across groups (Branded<B>, home/path helpers, timeout, retention)

Release expectations

Most groups are product — stable API. The exceptions: experimental/ publishes without stability or support promises, and test-support/ and util/ are support with lower compatibility expectations.


Dependencies

The dependency graph is generated: docs/module-graph.md (pnpm run gen-module-graph, freshness-gated in CI).

Extension plugins depend on Service Definitions, never concrete providers. dsh-agent-loop is swappable; UI, hook, and tool plugins use dsh-agent. Composition bundles may depend on spine plugins. Capabilities separate Service Definition / Service Provider / Consumer roles when they evolve independently; see capability seams.


Package README contracts

Every package README covers purpose, configuration, extension points, and Model Experience unless the model-agnostic omission allowlist exempts it. It also carries ## Known Limitations and Deferred Work or uses its allowlist. Package conventions — exports, service access, tests — live in packages/AGENTS.md.


Dev Note

Working context for maintainers — click to expand

None.