Repository navigation
Replies: 4 comments
|
+1, with an embedder's data point and the workaround we ended up shipping. We drive the SDK runtime as one of several agent runtimes inside a host Two additions to the report:
Server-side load/resume of the persisted log (as proposed here) would let us |
|
+1 This is critical for me as well. |
|
Adding a Voice Agent runtime use case where explicit SDK-level resume is important. I am currently researching a Python Voice Agent runtime architecture in which the real-time media worker owns audio, VAD, ASR, TTS, playback, and interruption handling, while DeepSeek Harness runs as a separate semantic agent/tool sidecar through the Python SDK. In this architecture, a telephone call or voice session can remain alive even if the DSH subprocess or Python worker is restarted. Examples include:
The external call has a stable identity, so it should be possible to map it to a stable DSH session and restore the native DSH event log in a new process. Replaying a plain
For a Voice Agent, that difference can be operationally important. For example, after a restart, the model must not blindly repeat a non-idempotent action such as booking an appointment merely because the host reconstructed only the conversational text and could not represent the previous tool outcome. I therefore support exposing an explicit Conceptually, I would expect the lifecycle to be: I would prefer explicit resume over silently making every Some protocol semantics that appear important for server and Voice Agent deployments are:
This also composes directly with the cancel/close proposal in #2888: A clean My current source baseline is rc.7 ( Questions I would be interested in hearing the maintainers’ view on:
For Voice Agent and other long-lived server integrations, native event-log resume would be substantially safer than reconstructing context through text transcript replay. |
|
+1 on 0.1.1rc1 — and the failure mode has changed in a way worth recording: it is now silent. We embed the SDK as an assistant runtime inside a FastAPI service, one harness process per turn (env is fixed at construction, so instances aren't reused across users), stable On 0.1.1rc1 the second turn from a fresh process does not report the id collision quoted in the OP. It completes normally:
So callers get a well-formed answer produced from an empty context while the persisted log silently stops growing. The rc6 error was more useful than this. Confirming the other half of the report on this version: We shipped the same workaround @jiaoqsh describes (host-side transcript sidecar replayed as a text block ahead of the current question), with the same caveats: text fidelity only, no tool calls or results, and the replayed history costs input tokens every turn. FWIW #4591 carries a community reference implementation of server-side resume plus a client-side shutdown fix (the final persistence batch is lost when |
Uh oh!
There was an error while loading. Please reload this page.
Summary
deepseek-harness-sdk0.1.0rc6 cannot resume a persisted session from a fresh runtime process. The firstrun()on a session works, but any laterrun()with the samesession_idin a new process (e.g., after the host process restarts, or when a server runs multiple workers and the next turn lands on a different worker) ends immediately with an empty response:Expected behavior
A persisted session should be resumable from a new process. The runtime already implements
session/load/session/resume(ACP methods), so a subsequent prompt should continue the conversation with the restored context instead of failing.Actual behavior
assistant/chunkdeltas and a finalassistant/messageare produced.session_idfrom a new runtime process: immediatelyturn/endwithreason.kind == "error"and the "id collision" message above. Noassistant/chunkevents;final_responseis empty;finish_reason == "error".run()calls with the samesession_idin the same runtime process: both succeed (the in-memory session object is reused).session/load(orsession/resume) directly viaharness.client.request(...)fails withJsonRpcError: unknown DeepSeek Harness SDK runtime method: session/load— the SDK JSON-RPC server only acceptsinitialize,session/prompt, andshutdown.Reproduction
Environment:
deepseek-harness-sdk==0.1.0rc6+ bundled runtime (deepseek-harness-runtime-bin==0.1.0rc6), modeldeepseek-v4-flashvia the official provider, Python 3.12.Impact
Suggested fix
session/load(orsession/resume) through the SDK JSON-RPC server — the runtime already implements these ACP methods; orsession/promptadopt an existing persisted log when the requested session is not already live (treat "load/resume it instead of creating" as the default for existing sessions).Environment
All reactions