Replies: 2 comments
|
I documented the restart boundary as an Agent-first runbook: same-ID in-process continuation vs cross-restart id collision, evidence capture, lossy history replay in a copied profile, and acceptance checks that preserve the original log. Guide: https://github.com/sandbaseai/deepseek-harness-handbook/blob/main/docs/en/getting-started/python-sdk.md#restart-recovery-sessionprompt-is-not-a-resume-operation |
0 replies
上下文 / Compact(「Python SDK cannot resume a persisted session after restart — session/prompt always creates and hits "id collision", existing conversations error on the next turn」)一上来就 compact,多半是 窗口读错 或压缩模型
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Python SDK (0.1.1rc1) + --profile sdk: after a harness restart, a turn on an existing session id fails with finish_reason: error and no output:
session "" already has a persisted log on disk that does not match this live session (id collision)
Root cause: the SDK JSON-RPC server always calls agents.create() (getOrCreateSession) and never resumes. The persistence layer's createCore rejects ids with an existing log ("load/resume it instead of creating"), and the SDK protocol (session/prompt) exposes no resume path. So any programmatic client loses all conversations on restart.
Reproduction
Run turn 1 with session_id="test-001", close the harness, start a new one (same dsh_home), run turn 2 with the same id:
In-process continuation (same harness + same id) works; only cross-restart resume fails.
Expected
session/prompt should resume the persisted session when a log exists (the persistence layer already implements resume; the SDK just never calls it), or expose an explicit resume/open method, or at least return a recoverable error code.
Workaround
Client-side history replay: on first turn after restart, clear the stale log and feed the conversation history as content blocks. Restores context but loses harness-internal state (tool results, summaries).
Related: #466, #483, #387 (session persistence across restarts, web-host perspective). Reproduced 2026-08-29, SDK 0.1.1rc1 / dsh 0.1.1-rc.2.
All reactions