fix: replace deleted assistant/chunk with live agent/assistant-stream… - #557
Open
later0day wants to merge 5 commits into
Open
fix: replace deleted assistant/chunk with live agent/assistant-stream…#557later0day wants to merge 5 commits into
later0day wants to merge 5 commits into
Conversation
… mirror
The durable assistant/chunk event was deleted in DSH 0.1.3-alpha.1.
Replacements:
- durable: settled assistant/message and each assistant/attempt embed the
step's timed stream (expandAssistantStream extracts first token time)
- live: host event agent/assistant-stream with {agent, frame} payload
Changes:
- New src/sidechat-live.ts: createAssistantStreamMirror() buffers one
in-flight prefix per session from agent/assistant-stream frames.
Guard: reject by attemptId mismatch or revision <= seen revision.
revision is allocated PER FRAME by the host agent-loop, not per
attempt — only attemptId carries identity.
- sidechat-core.ts: buildOpenTurnSnapshot now reads settled
assistant/message content blocks (text → text, reasoning → reasoning),
skipping superseded assistant/attempt.
- sidechat-transcript.ts: appendLiveRows() renders the live prefix as
an unsettled tail row, dropped once the step's assistant/message is
in the log.
- SideChatView.tsx: ThreadCache carries live prefix; fetchThread computes
liveChanged and bumps revision on change.
- sidechat-routes.ts: sidechat.events reads live AFTER the log, so the
settled step and its live prefix never appear together.
- context-types.ts: typed on('agent/assistant-stream') overload +
SidebarAssistantStreamFrame union.
- Tests: 7 new unit tests for the mirror; existing tests updated.
Verified: RPC-level (live prefix grows monotonically and equals settled
text prefix) and UI-level (DOM shows mid-stream half-sentence then
settled full text).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… shell-not-found banner, WS close reason UTF-8 truncation)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… mirror
The durable assistant/chunk event was deleted in DSH 0.1.3-alpha.1. Replacements:
Changes:
Verified: RPC-level (live prefix grows monotonically and equals settled text prefix) and UI-level (DOM shows mid-stream half-sentence then settled full text).