Skip to content

Maybe a bug in dsh rc-7 #2

Description

@Mohei-Muun

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)

  1. Stop emitting the custom event; derive quota/audit from existing standard events
    (tool/call + tool/result) — no harness change needed.
  2. 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.
  3. 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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions