You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug] Cancelling a task that spawned subagents permanently corrupts session persistence — production data integrity failure, no recovery path for operators
#3662
In a production-like workflow: a task spawns subagents (via the subagent tool), then the user cancels / aborts the task (stop button, interrupt, or re-send). After this:
The parent session gains turn/end events with reason.kind: "aborted" at its tail. Repeated cancellations accumulate multiple aborted turns.
The subagent sessions (forked child sessions) are left hanging: their logs contain unclosed turn/start / step/start and tool/call entries with no matching tool/result.
Eventually the parent session fails to load entirely — the persistence layer refuses the log ("history unavailable"), the session becomes unreadable, and the data, though present on disk, is effectively lost to the user.
This is not a one-off: it reproduces every time a task with subagents is cancelled or re-sent.
Expected behavior
Cancelling a task is a normal, first-class operation in production (manual abort, timeout, re-queue). It must not leave permanent corrupting artifacts in session persistence.
Aborted turns should be recoverable / resumable markers, not terminal states that make the session unusable.
Child (subagent) sessions should be closed cleanly (or explicitly marked abandoned) when the parent task is cancelled — not left with unclosed turns/steps forever, leaking persistence state.
The system must degrade gracefully: preserve data integrity and accessibility after a cancellation, without requiring manual log surgery.
Impact scope (production focus)
High-frequency operation: cancelling/re-sending agent tasks (especially ones that spawn subagents) is routine in production. Every occurrence deposits corrupting artifacts + hanging subagent sessions.
Sessions degrade cumulatively — each cancellation moves the session closer to permanent unreadability.
Data integrity failure: the persisted log becomes logically inconsistent (seq/state violations) while the file itself looks intact on disk — the worst kind of failure to diagnose.
No recovery path for operators: restoring the session today requires manual, surgical, byte-level log editing (frame-accurate truncation + seq repair). This is not achievable by a production operator or non-technical user.
The corruption lives in the shared persistence layer, so every consumer of the session data is affected — no entry point can read the session once the log is rejected.
Repro
In a session, issue a command that spawns subagents (e.g. the subagent tool).
While it runs, cancel (or re-send the message).
Repeat 2–3 times.
Reopen the parent session → the persistence layer rejects the log; the session is unreadable.
Subagent tool: subagent (spawns child sessions under ~/.dsh/sessions/...)
Evidence (sanitized)
Parent session tail after cancelling twice:
turn 47: turn/end reason=completed <- last good turn
turn 48: turn/end reason=aborted <- from cancellation #1
turn 49: turn/end reason=aborted <- from cancellation #2
session/end-seed
Hanging subagent sessions (children of the parent):
subagent A: unclosed turn/start, unclosed step/start
subagent B: unclosed turn/start, unclosed step/start, tool/call with no matching tool/result
Recovery only worked after truncating the parent log at turn 47's turn/end (frame-accurate surgery); the subagent sessions remain in a permanently inconsistent state.
EN: Reported by the OfferKuai (Offer快) Team — an AI startup building full-lifecycle job-application services, guided by the belief that "users need results, not repeated conversations." Founder: Zhaofeng (Yaming). We use DeepSeek Harness as part of our daily development workflow; this report is our way of contributing back to the ecosystem. Website: https://www.offerkuai.com/ | Contact: <contact@offerkuai.com>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
EN / English
Observed behavior
In a production-like workflow: a task spawns subagents (via the
subagenttool), then the user cancels / aborts the task (stop button, interrupt, or re-send). After this:turn/endevents withreason.kind: "aborted"at its tail. Repeated cancellations accumulate multiple aborted turns.turn/start/step/startandtool/callentries with no matchingtool/result.This is not a one-off: it reproduces every time a task with subagents is cancelled or re-sent.
Expected behavior
Impact scope (production focus)
Repro
subagenttool).Environment
@deepseek-ai/dsh0.1.0-rc.6/0.1.0-rc.7@deepseek-ai/dsh0.1.1-rc.2session.jsonl.zstd), strict contiguous seq from 0subagent(spawns child sessions under~/.dsh/sessions/...)Evidence (sanitized)
Parent session tail after cancelling twice:
Hanging subagent sessions (children of the parent):
Recovery only worked after truncating the parent log at turn 47's
turn/end(frame-accurate surgery); the subagent sessions remain in a permanently inconsistent state.中文版 / ZH
现象
在生产类工作流中:任务通过
subagent工具启动子 agent,然后用户取消/中止该任务(停止按钮、中断、或撤回重发)。此后:reason.kind: "aborted"的turn/end。反复取消会累积多个 aborted 轮次。turn/start/step/start,以及没有对应tool/result的tool/call。这不是偶发:每次取消/重发带子 agent 的任务都会复现。
期望行为
影响范围(生产视角)
复现步骤
subagent工具)。环境
@deepseek-ai/dsh0.1.0-rc.6/0.1.0-rc.7@deepseek-ai/dsh0.1.1-rc.2上验证session.jsonl.zstd),seq 从 0 严格连续subagent(在~/.dsh/sessions/...下派生子会话)证据(脱敏)
父会话尾部(取消两次后):
悬挂的子 agent 会话(父会话的子会话):
只有把父日志截断到 turn 47 的
turn/end(帧级手术)后会话才恢复可读;子会话仍处于永久不一致状态。署名 / About this report
EN: Reported by the OfferKuai (Offer快) Team — an AI startup building full-lifecycle job-application services, guided by the belief that "users need results, not repeated conversations." Founder: Zhaofeng (Yaming). We use DeepSeek Harness as part of our daily development workflow; this report is our way of contributing back to the ecosystem. Website: https://www.offerkuai.com/ | Contact: <contact@offerkuai.com>
ZH: 本报告由 OfferKuai(Offer快)团队提交 —— 一家专注 AI 全流程求职托管的创业团队,核心理念是「用户要的是结果,不是重复对话」。创始人:Zhaofeng(Yaming)。我们将 DeepSeek Harness 用于日常开发工作流,这份报告是我们对社区的回馈。官网:https://www.offerkuai.com/ | 联系:<contact@offerkuai.com>
All reactions