feat: replace full-message polling with incremental streaming updates#78
Merged
Conversation
Upgrade SDK to v0.18.1 and use new incremental callbacks (onAssistantMessageAdded, onAssistantContentUpdated, onAssistantReasoningUpdated, onToolBlockUpdated) instead of onMessagesChange for streaming updates. - Extract chatReducer to standalone module with 4 new incremental actions - Add 16ms throttle (~60fps) for content/reasoning, stage='end' fires immediately - React.memo on Message component with custom comparator - MessageList key changed to message.id for stable identity - onMessagesChange retained only for clear/restore/rewind scenarios - Add 23 unit tests for chatReducer incremental actions - Fix tests/tsconfig.json deprecation warnings
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.
Summary
Upgrade SDK to v0.18.1 and use new incremental callbacks instead of
onMessagesChangefull-message polling for streaming updates.Changes
SDK Upgrade (v0.17.12 → v0.18.1)
onAssistantMessageAdded,onAssistantContentUpdated,onAssistantReasoningUpdated,onToolBlockUpdatedArchitecture
webview/src/reducers/chatReducer.ts) with 4 new incremental actionsstage='end'fires immediately to avoid finalization delaymessage ===,isStreaming,isQueued)message.idfor stable identityonMessagesChangeretained only for clear/restore/rewind scenariosNew Files
webview/src/reducers/chatReducer.ts— extracted reducer with APPEND_MESSAGE, UPDATE_STREAMING_CONTENT, UPDATE_STREAMING_REASONING, UPDATE_TOOL_BLOCKtests/reducers/chatReducer.test.ts— 23 unit tests for all reducer actionsBug Fixes
tests/tsconfig.jsondeprecation warnings (moduleResolution: node→bundler)ReasoningBlockto webview type exports