AI as reference:
draw/generated session events make sessions unloadable after restart
Environment: dsh 0.1.0-rc.7 (DSH Desktop v2.0.1, Windows) · dsh-draw 0.1.0
Summary
Every image generation appends a draw/generated session event via
session.append('draw/generated', event) (lib/types/session-events.js), but the
event is written without the ignorable: true envelope marker. The harness
session loader (@deepseek-ai/dsh-session's hardcoded KNOWN_SESSION_EVENT_TYPES +
@deepseek-ai/dsh-session-persistence's assertEventsSupported) refuses to load any
log containing an event type outside its built-in 44-type set unless the event is
marked ignorable. Result: any session where the user generated an image fails to
reopen after a harness restart:
SessionFormatUnsupportedError: session "..." contains event type "draw/generated" (seq 73527)
unknown to this harness and not marked ignorable; refusing to interpret the log —
it was likely written by a newer harness
(The log file itself is intact — the loader simply refuses it. "likely written by a
newer harness" is the loader's generic guess, not the actual cause.)
Root cause
lib/types/session-events.js documents the event as "log-only (ignorable)", but the
actual call never sets the flag. The two-argument form was chosen for rc.6 peer
compatibility — however the rc.7 session.append() API does not expose an envelope
option to set ignorable, and the harness currently has no registration surface for
downstream plugin event types (the comment in @deepseek-ai/dsh-session says such a
surface is "deferred until such a consumer exists" — this plugin is exactly that consumer).
Impact
- Session history unavailable after restart; quota accounting in
lib/types/quota.js
(which scans drawGeneratedEvents) also cannot run for these sessions.
- Any future session using image generation will hit the same issue.
Suggested fixes (pick one)
- Stop emitting the custom event; derive quota/audit from existing standard events
(tool/call + tool/result) — no harness change needed.
- Mark the event
ignorable: true once the harness exposes a way to set it from
session.append(), or once a plugin event-type registration surface exists.
- Coordinate with harness maintainers to add the deferred plugin event-type
registration surface (dsh-draw is the first real consumer).
Workaround for affected users (meanwhile)
Patch the persisted log to add "ignorable": true to the draw/generated events
(each write batch is an independently zstd-compressed frame; the loader then skips
those events and the rest of the history loads).
AI as reference:
draw/generatedsession events make sessions unloadable after restartEnvironment: dsh
0.1.0-rc.7(DSH Desktop v2.0.1, Windows) · dsh-draw0.1.0Summary
Every image generation appends a
draw/generatedsession event viasession.append('draw/generated', event)(lib/types/session-events.js), but theevent is written without the
ignorable: trueenvelope marker. The harnesssession loader (
@deepseek-ai/dsh-session's hardcodedKNOWN_SESSION_EVENT_TYPES+@deepseek-ai/dsh-session-persistence'sassertEventsSupported) refuses to load anylog containing an event type outside its built-in 44-type set unless the event is
marked ignorable. Result: any session where the user generated an image fails to
reopen after a harness restart:
(The log file itself is intact — the loader simply refuses it. "likely written by a
newer harness" is the loader's generic guess, not the actual cause.)
Root cause
lib/types/session-events.jsdocuments the event as "log-only (ignorable)", but theactual call never sets the flag. The two-argument form was chosen for rc.6 peer
compatibility — however the rc.7
session.append()API does not expose an envelopeoption to set
ignorable, and the harness currently has no registration surface fordownstream plugin event types (the comment in
@deepseek-ai/dsh-sessionsays such asurface is "deferred until such a consumer exists" — this plugin is exactly that consumer).
Impact
lib/types/quota.js(which scans
drawGeneratedEvents) also cannot run for these sessions.Suggested fixes (pick one)
(
tool/call+tool/result) — no harness change needed.ignorable: trueonce the harness exposes a way to set it fromsession.append(), or once a plugin event-type registration surface exists.registration surface (dsh-draw is the first real consumer).
Workaround for affected users (meanwhile)
Patch the persisted log to add
"ignorable": trueto thedraw/generatedevents(each write batch is an independently zstd-compressed frame; the loader then skips
those events and the rest of the history loads).