Commit Graph
8 Commits
Author SHA1 Message Date
Tianyi Cui 03f91a5471 fix: retain local subagent completion identity 2026-07-14 07:29:40 +08:00
Tianyi Cui 9ebb40b84b fix: keep SDK subagent notifications local 2026-07-14 02:28:04 +08:00
Tianyi Cui 61136b22bb refactor: remove UI identity translations 2026-07-14 02:09:09 +08:00
Tianyi Cui 709cc7200e refactor: unify agent and session identity 2026-07-14 01:59:21 +08:00
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
Yichen Jiang 5d913a796a jsonrpc: harden Python SDK lifecycle and protocol 2026-07-13 16:34:03 +08:00
imccyu 7696f88d9f jsonrpc: adapt to async agent creation and scoped subagent events 2026-07-13 15:57:12 +08:00
imccyu 67fe6c10b6 jsonrpc: SDK serving surface as plugins (dsh-jsonrpc + dsh-jsonrpc-agent) 2026-07-13 15:50:09 +08:00