description: "The stdio JSON-RPC serving plugin for deployments that let out-of-process SDK clients open sessions and drive agents in a DeepSeek Harness runtime."
English | 中文
dsh-sdk-jsonrpc-server serves the SDK wire protocol over stdio so out-of-process clients can drive harness agents: it opens one session per sessionId, queues user prompts, and streams every session event and agent status transition back to the client. Mount it as the jsonrpc plugin in a Loader composition; the surrounding tree supplies everything else — agents, model adapters, persistence, and tools. Stdout carries only JSON-RPC frames, so a deployment must not compose a stdout logger. It answers shutdown by disposing the root runtime and exiting 0; the app bin owns EOF and signal exits.
Mount this plugin when a runtime must serve SDK clients: add it to a cordis.yml that composes the agent service, boot the runtime, and clients connect over stdio. The common path is explicit — the plugin needs the agents service; every other capability comes from the surrounding tree.
The plugin creates one agent per sessionId on first use. A registered model adapter wins the route; an unowned deepseek-official route mounts the DeepSeek adapter, and any other unowned provider fails initialization. The selected adapter resolves the exact model and optional reasoning effort before initialization succeeds.
| Field | Default | Meaning |
|---|---|---|
maxTokensAsSuccess |
false |
Report max-token turn/subagent termination as a successful SDK result |
The profile composition owns each root agent's tools. input, output, and exit are runtime-only transport hooks for tests; production uses process stdio and process.exit. The generated configuration catalog is the exhaustive source for every accepted field.
Stdout carries only JSON-RPC frames, so clients can parse every byte; diagnostics belong on stderr. Keep stdout loggers out of the composed tree.
initialize is the runtime-readiness boundary: when the server is mounted by a Loader composition, it waits for the current plugin tree to settle before replying, so async sibling capabilities such as initial MCP tool discovery are visible to the first prompt. The handshake returns the wire-stable identity deepseek-harness-sdk-runtime. The server validates the provider/model route and optional non-empty reasoningEffort through the selected adapter before it stores them; omission stores no effort, so the model retains its own default. An optional positive maxTokens becomes the request output cap of each SDK-created agent and its in-process descendants, while omission applies the selected adapter or provider route default. JSON-RPC requests may dispatch concurrently, so session/prompt rejects until one initialize has completed successfully; clients must await the handshake before sending prompts. An accepted prompt queues one identified user message and immediately returns { messageId }; the server then streams every durable fact as session.event and every whole-agent lifecycle transition as session.status. It does not assign an assistant message or turn/end to a prompt, and independent requests may enqueue more work on the same session. Persistence roots and persona come from the surrounding composition.
The plugin answers shutdown, flushes the response, disposes the root context so SDK-owned agents, subscriptions, and persistence reach quiescence, then exits 0. EOF and signal exits belong to the app bin, which also disposes the root context. Unloading only this plugin stops serving without exiting the process.
Read these pages when the plugin contract is not enough. They move from the wire protocol to the clients and the runnable application.
dsh --profile sdk application that boots this plugin.For each accepted session/prompt, text and durable content references enter one user message verbatim. Inline SdkEncodedImageBlock values are validated and committed through the composition's attachment store first, so the session log retains content-addressed image references rather than base64 bytes. This package adds no system-prompt prose or tool schema; those come from the other plugins in the composition.
Data-dependent user-message tokens enter retained session history and are resent on later turns until another package compacts them. The JSON-RPC frames, session notifications, and server bookkeeping add zero model-context tokens.
Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.
These limits define when the plugin needs special operational care. They are current package constraints, not a comparison with other serving approaches or a task backlog.
MessageId identifies inbox admission only; clients that own an automation interval must define and observe that interval themselves.initialize can reuse any pre-registered model adapter, but its only fallback mounts the DeepSeek adapter.