Repository navigation
Replies: 2 comments
|
I re-checked this against the current Re-verified on
|
Still reproducible on Desktop 0.2.1-rc.2 - a concrete producer found in a published pluginEnvironment: DeepSeek Harness Desktop Producer: agent.cancel({ kind: 'thinking-guard', reason, detail, sessionId: st.sessionId });
Client on 0.2.1-rc.2: the crashing slot is now The error boundary blanks the whole chat pane; the trajectory view keeps working. One behavior worth recording: repairing the poisoned row on disk is not enough while the host is running - the live session keeps the old event in memory, and the client keeps crashing until the display process is restarted (a page reload does not clear it). What we did locally (three layers, none of them touching the DSH install):
Suggested upstream order (cheapest first):
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
When a runtime caller or third-party plugin invokes
agent.cancel(cause)with a malformed runtimecause(for example passing a string'disposed'instead of{ kind: 'disposed' }),ReactLoopAgent.cancel()does not validatecauseat the call site and passes it directly tothis.phase.abort.abort(cause).When the active turn catches the abort and calls
abortedCancelCause(signal),assertNever(cause)throws inside thecatchblock beforeturnEndsis assigned. Thefinallyblock then executesthis.session.append('turn/end', { turn, reason: turnEnds! })withturnEnds === null, durably persisting{"type":"turn/end",...,"data":{"turn":N,"reason":null}}into the session log (session.v4.jsonl.zstd).Once this event is persisted,
@deepseek-ai/dsh-client-ui-chatpermanently white-screens on that session across restarts when readingevent.data.reason.kind.Reproduction
Minimal reproduction using
@deepseek-ai/dsh-agent-loop:Current behavior
ReactLoopAgent.cancel(cause)(packages/core/agent-loop/src/agent.ts:174-180) clears the inbox and callsthis.phase.abort.abort(cause)without validatingcause.ReactLoopAgent.turn()(packages/core/agent-loop/src/agent.ts:369-394):abortedCancelCause(signal)(packages/core/agent-loop/src/agent.ts:78-92) throwsError: unreachable variant: "disposed"inside thecatchblock,turnEndsremainsnull.this.session.append('turn/end', { turn, reason: turnEnds! })succeeds becausenullis valid JSON andvalidateSessionEventData(packages/core/session/src/surface.ts:207) does not validateturn/endpayloads.session.v4.jsonl.zstd) now contains:{"type":"turn/end","seq":49,"time":1791626380934,"data":{"turn":4,"reason":null}}@deepseek-ai/dsh-client-ui-chat(e.g.packages/client/ui-chat/src/client/apply.ts:106,ChatGroupSeat.tsx:149,TurnProcessNodeView.tsx:20,conversation-nodes/turn-error.ts:66,conversation-nodes/turn-max-tokens.ts:51,conversation-nodes/turn-tail.ts:82),event.data.reason.kindis accessed assumingreasonis non-null, throwingTypeError: Cannot read properties of null (reading 'kind')and causing the Chat view to white-screen even after restarting the desktop app (while the Trajectory view still renders).Expected behavior
ReactLoopAgent.cancel):cancel(cause)should validatecausesynchronously before clearing the inbox or abortingthis.phase.abort, throwing immediately at the caller site ifcauseis not a validAgentCancelCauseobject.turn/endwithreason: null:Session/ReactLoopAgent.turn()should never commit aturn/endevent with anullreasonto the durable event log.Environment
master(d743267388,dsh-v0.2.1-alpha.2) and Desktop0.1.0-alpha.12All reactions