Repository navigation
Replies: 3 comments
|
强杀之后没刷盘的尾巴,官方加载器只会尝试修 torn tail;已经提交进去的缺口它不会动。 如果重启后会话打不开或最后几轮丢了,可以用会话医生先看文件健康( dsh plugin --profile web add "github:xiaoshenming/dsh-session-surgeon#main" |
0 replies
0 replies
|
你这张图是 composer 槽卸载时 React 如果崩溃之后刷新也打不开那条会话,才是磁盘日志的问题,可以用: dsh plugin --profile web add "github:xiaoshenming/dsh-session-surgeon#main"重启后左侧「会话医生」看 health。刷新就能继续聊的,按你说的是 composer 缺陷,等官方修槽位卸载即可。 |
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.
Bug report: after a manual force-kill of the DSH host (parallel agents deadlocked, process killed + restarted), user input appears late or never — session/message reload after restart does not recover what was in flight
Environment
dsh web,127.0.0.1:3080)47f943859bConfirmed background (this report's root cause context)
killof the process, not a graceful shutdown), then restarted.Key finding: a force-kill drops every event still in the durable write-behind buffer
Session contents are persisted with a bounded write-behind batch in
session-persistence(packages/session/session-persistence):coordinator.tsDEFAULT_WRITE_BATCH_MAX_DELAY_MS = 200(line 30). Appended events are not written immediately; they sit in an in-memorypendingqueue until a per-session timer fires the durable write (write-behind.tsline 45enqueue, line 82armTimer, line 143startWrite→options.write, which fsyncs).pendingsynchronously to quiescence areflush()(write-behind.tslines 63–72,drainBarrier) and the coordinator's explicit disposer drain (coordinator.tslines 1091, 1139 observe disposed sessions).kill/force-kill never runsflush()or the disposer drain. Any events still inpending— or in the middle of an in-flight fsync — at the moment the process died are lost from durable storage. They only existed in memory.The JSONL/SQLite backends then reload only the committed prefix on restart:
session-persistence-jsonl):readZstdPrefix(index.ts 348–419) decodes complete frames and recovers only the torn-tail committed events; the crash-repair (commitRepair,repair) truncates to the last complete frame and discards the un-committed in-flight tail. Events that never flushed are simply absent.session-persistence-sqlite): test "an interrupted turn ... is PRESERVED and closed during load" / "a corrupt-JSON row in the uncommitted tail is discarded on load" (sqlite.spec.ts 258–350) confirms that after a crash, un-committed tail rows are dropped and the load rebalances to a committed prefix.Why this explains the reported symptoms
"History invisible / can't see what I wrote before" (matches [bug] Under heavy load new user requests no longer appear in the conversation/request view at all - history invisible (gap-repair strands user/message events) #479 escalation): After restart the web GUI re-loads each session's messages from the committed prefix. Any user message or turn that was in the write-behind buffer (or a torn in-flight frame) at kill time is permanently gone from the durable log, so the GUI correctly shows nothing for it — but the user had typed/seen it, so it looks like their history vanished. This is durable data loss caused by the force-kill + write-behind batching, not just a live-stream rendering bug.
"Input appears much later" (matches [bug] User text input delayed by a long time under heavy concurrent load (queued behind a busy agent turn - no pending feedback) #477): After restart the harness is cold: sessions are re-materialized from disk, the browser reconnects (mux/host WebSockets close on host death and the client re-pulls
session.list+ history on reconnect —packages/client/runtime/src/client/sessions/manager.tsre-pull-on-reconnect), and the agent queue is rebuilt from the (truncated) durable log. Until that recovery completes, new input is queued behind the re-loading/busy loop, and the reconstituted turn numbering may re-order/steer queued messages, so a typed message can surface much later or be re-delivered differently than the user expected.The restart is likely the transition that turned "delayed" into "never visible": the in-flight tail is lost at the kill, and the same write-behind + gap-repair mechanics analyzed in [bug] User text input delayed by a long time under heavy concurrent load (queued behind a busy agent turn - no pending feedback) #477/[bug] Under heavy load new user requests no longer appear in the conversation/request view at all - history invisible (gap-repair strands user/message events) #479 (
session.tsacceptLiveEvent/repairGap,agent-loop/agent.tsserial turn) operate on a now-truncated, lower-seq log, so subsequent live events can carry the wrong expectations and strand or reorder after restart.Relationship to the prior two reports
Expected behavior
user/messageevents (the most valuable content) and turn/step boundaries, and a bounded cap plus backpressure so a deadlocked overload cannot grow an unbounded in-memory loss window.Suggested areas to look at
packages/session/session-persistence/src/write-behind.tsandcoordinator.ts— durability of the batching tail; flush-on-user-input; loss-window reduction and explicit "tail truncated" signal.packages/session/session-persistence-jsonl/src/index.ts(readZstdPrefix,commitRepair,repair) andsession-persistence-sqlite— surfacing truncated-tail state to the web layer.packages/client/runtime/src/client/sessions/manager.ts(reconnect re-pull) andsession.ts(acceptLiveEvent/repairGap) — recovery UX (reloading indicator, recoverable pending drafts) and gap-repair robustness after restart.session.historyafter reconnect (should mark missing tail from unclean shutdown).Happy to attach the actual
.zstdsession logs (pre/post kill) if that helps confirm the exact truncated commit point.All reactions