Skip to content

feat: replace full-message polling with incremental streaming updates#78

Merged
lewis617 merged 1 commit into
mainfrom
feat/webview-incremental-updates
Jun 30, 2026
Merged

feat: replace full-message polling with incremental streaming updates#78
lewis617 merged 1 commit into
mainfrom
feat/webview-incremental-updates

Conversation

@lewis617

Copy link
Copy Markdown
Contributor

Summary

Upgrade SDK to v0.18.1 and use new incremental callbacks instead of onMessagesChange full-message polling for streaming updates.

Changes

SDK Upgrade (v0.17.12 → v0.18.1)

  • Uses new incremental callbacks: onAssistantMessageAdded, onAssistantContentUpdated, onAssistantReasoningUpdated, onToolBlockUpdated

Architecture

  • Extract chatReducer to standalone module (webview/src/reducers/chatReducer.ts) with 4 new incremental actions
  • 16ms throttle (~60fps) for content/reasoning updates; stage='end' fires immediately to avoid finalization delay
  • React.memo on Message component with custom comparator (message ===, isStreaming, isQueued)
  • MessageList key changed to message.id for stable identity
  • onMessagesChange retained only for clear/restore/rewind scenarios

New Files

  • webview/src/reducers/chatReducer.ts — extracted reducer with APPEND_MESSAGE, UPDATE_STREAMING_CONTENT, UPDATE_STREAMING_REASONING, UPDATE_TOOL_BLOCK
  • tests/reducers/chatReducer.test.ts — 23 unit tests for all reducer actions

Bug Fixes

  • Fix tests/tsconfig.json deprecation warnings (moduleResolution: nodebundler)
  • Add ReasoningBlock to webview type exports

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
@lewis617 lewis617 merged commit a651153 into main Jun 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant