Repository navigation
Storage crash: Cannot read properties of undefined (reading 'prepare') corrupts session logs -> SessionFormatError -> sessions silently dropped from workspace list #8517
Unanswered
huangziyuan-general
asked this question in
Q&A
Replies: 1 comment
这个报错串本周已出现第二次——请与
|
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.
Storage crash
Cannot read properties of undefined (reading 'prepare')corrupts session logs → SessionFormatError → sessions silently dropped from workspace listEnvironment
0.1.7-rc.1→0.1.7-rc.2(web profile, macOS,dsh webon port 3080)session.v4.jsonl.zstd, multi-frame zstd)What happened
While a turn was executing a bash tool call, the storage layer crashed:
The turn ended in an error state before the tool result was persisted. The v4 log was then left with a
tool/callevent that has no matchingtool/result.On the next startup, the v4 loader rejects the whole session:
Worse: the failed session is also deregistered from the workspace registry (
~/.dsh/storages/workspace.json→tables.workspaces[].sessionIds), so even after manually repairing the log file, the session never reappears in the UI list — it only shows up via the third-party archive plugin's inventory asunreadable.This hit 4 sessions across 2 workspaces on my machine within one evening (2026-09-28, ~22:26), all with the same fingerprint. It looks like a recurring bug, not a one-off — possibly triggered by concurrent SQLite access from a project whose tooling also uses SQLite.
Expected behavior
TOOL_NOT_STARTEDerror result (or flush the turn cleanly) so the log stays loadable.Recovery notes (for anyone hitting this)
The session log format itself is fine to repair manually, but there are several non-obvious invariants worth documenting: multi-frame zstd layout (frame 1 = exactly the header line), 0-based seq, message events require top-level
surfaceOp:"append"+ non-emptymessage.id, and results for calls without an independenttool/callevent must use the nativeTOOL_NOT_STARTEDrepair shape. Re-compressing the whole log as a single zstd frame makes it unreadable to the loader.Happy to provide anonymized session files if useful. Related feedback: it would help a lot if
dshshipped adsh session doctor/repairsubcommand for this.All reactions