summaryrefslogtreecommitdiffhomepage
path: root/src/features/account-usage
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-10-22 15:48:50 +0900
committerAdam Malczewski <[email protected]>2026-10-22 15:48:50 +0900
commit53686ae6446c5c59928244f65c08150fb564b375 (patch)
tree1b033bf09d30872c04f098a3c016e09481a7209b /src/features/account-usage
parent511d415b4ec07d435ea73ab8e5421949392d922d (diff)
downloaddispatch-web-53686ae6446c5c59928244f65c08150fb564b375.tar.gz
dispatch-web-53686ae6446c5c59928244f65c08150fb564b375.zip
fix(chunks): keep tool calls visible when opening an in-flight chat
Opening (or switching back to) a conversation with a running turn showed a tail of "Thoughts" blocks with no tool cards. The late-join replay re-delivers the whole in-flight turn as provisional chunks; committedOverlap hides the ones already in committed history by aligning both runs chunk-by-chunk. When that alignment failed, the whole replay rendered as a duplicate, and because tool cards de-dup by toolCallId onto the first (committed) occurrence, the duplicate tail showed only thinking/text. The alignment broke in four ways, all reproduced against a live server: - Claude returns several thinking blocks per step (one signature each). History persists them separately, but reasoning-deltas carry no block boundary, so live/replay merges them. Now one provisional text/thinking chunk matches a run of committed chunks whose texts concatenate to it. - Images persisted mid-turn (tool attachments) have no live event. The walk now steps over them. - The chat-limit window/trim unloads the committed turn's head, so the committed run is a suffix while the replay starts at turn-start. Alignment now re-anchors (committed head, else the run's first tool chunk; text anchors must verify the whole overlap) and hides replayed chunks whose committed twins were unloaded. - Re-subscribing (tab switch / reconnect) replays the turn on top of the existing provisional copy. A turn-start for a turn that already has provisional content now replaces the stale copy. trimTranscript also counted those invisible duplicates toward the chat limit, unloading real history (incl. the turn head) to make room for them; it now counts rendered chunks (selectRenderedCount). svelte-check 0 errors · biome clean · 2488 tests pass · build OK
Diffstat (limited to 'src/features/account-usage')
0 files changed, 0 insertions, 0 deletions