Replies: 2 comments
|
This is not a stored-chunk problem — the payload that "trips the check" is every plain object, and the trigger is the browser. Are you on Firefox or Zen? I believe this is the same root cause as #5677 / #5709, already fixed on Why the replayed chunk looks corrupt. Function.prototype.toString.call(constructor) === `function ${name}() { [native code] }`ECMAScript leaves that rendering implementation-defined. V8 emits one line; SpiderMonkey emits three. On a Firefox-engine browser every plain object therefore fails Your "new sessions work, reopened ones don't" detail is the giveaway, and it is the part that made this look like a replay-only data problem. Live streaming renders from Reproduced. Stubbing only the native-function rendering to SpiderMonkey's form and expanding an ordinary stored stream: Byte-identical to yours. Under V8 rendering the same stream expands cleanly, which is why Chromium users never see it. The fix collapses whitespace before comparing, at the four mirrored sites ( Reference patch: Saidoua@d68ea1a On your local patch: once the guard is engine-tolerant you should not need it, and I would drop it rather than keep it — skipping records that fail validation would have hidden this bug instead of surfacing it, and on an affected browser it silently discards every chunk. Your suggestion (2) is a real design question independent of this bug — whether one invalid record should blank a conversation — but it is worth deciding on its merits rather than as a workaround for this. If you are on Chromium and still hitting it, then it is a genuinely different defect and worth saying so, because the fix above will not help you. |
|
+1, independently root-caused the same thing on 0.1.5-rc.2 (Firefox, macOS, server Node v22.22.1) — confirming SpiderMonkey's multi-line native Function.prototype.toString vs the exact-string fingerprint in hasIntrinsicConstructor. Extra data points from a full trace (disk, wire, and browser all inspected live):
Workaround in use: whitespace-normalize the comparison in the two browser-served copies ( |
Uh oh!
There was an error while loading. Please reload this page.
I'm reporting a bug (I don't have issue permissions, so posting here — maintainers: happy to help move it to Issues / provide more logs).
Version: @deepseek-ai/dsh 0.1.3-alpha.1 (dev checkout, dsh web, web profile) · Node v24.19.0 · Linux
Symptom: after a dsh web restart, opening any session that predates the current process shows a permanently blank chat. The session list renders fine and brand-new sessions work, but existing conversations never display their history. While the chat is in that state, approval/consent dialogs also show an empty command area (only the reason text renders).
No data is lost — the on-disk session logs are intact, and the server-side read path returns the full history for every session.
Browser console shows, repeatedly:
Uncaught TypeError: Assistant stream raw chunk must be a lossless JSON object
Caused by: TypeError: Assistant stream chunk must be losslessly JSON-serializable
assistant-stream.ts:261:15
[session-controller] event feed subscriber failed: TypeError: Assistant stream raw chunk must be a lossless JSON object
Repro steps:
New sessions created after a restart display fine until they are reopened after a later restart.
Root-cause analysis (client-side): validation in the assistant-stream module (assistant-stream.ts, validateRecord/snapshotChunk) throws when a replayed stream chunk record's payload is not a losslessly JSON-serializable plain object. expandAssistantStream then aborts the whole replay → the conversation never assembles → blank chat and the [session-controller] event feed subscriber failed cascade. The approval panel is affected for the same reason: its command box is filled by ApprovalCommand (dsh-client-ui-chat), which looks up the matching tool-call node in the same (broken/empty) conversation snapshot — no node, no command text. I could not isolate which specific chunk payload trips the check; it appears during reconstruction on replay, not in the stored JSONL.
Workaround (local, not a fix): patched the embedded expandAssistantStream in the four installed client bundles (dsh-client-ui-chat, dsh-client-ui-trajectory, dsh-api-session-controller, dsh-client-connection → lib/client.js) to skip records that fail validation instead of throwing:
js
for (const candidate of stream) {
let record;
try {
record = validateRecord(candidate);
} catch {
continue;
}
...
}
After this, history renders again and approval dialogs show their command text. Session data was never modified.
Suggestions for maintainers: (1) root-cause the replayed chunk that fails lossless-JSON validation on resume; (2) make expandAssistantStream skip/log a single invalid record instead of killing the whole conversation; (3) consider rendering cold history independently of the live assistant-stream replay (the read path already supports this).
Happy to provide more details, logs, or test builds.
All reactions