fix: reduce UI load during streaming sessions#449
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on reducing frontend CPU and overhead during high-volume streaming SSE sessions by consolidating event consumption, throttling expensive markdown work, and avoiding unnecessary recomputation in the chat timeline.
Changes:
- Routes event/status/question consumers through
SyncProviderto avoid duplicate active-project SSE connections and removes per-event SSE hot-path logging. - Adds a subscription mechanism to
SyncProviderso other contexts (likeEventProvider) can consume the same parsed event stream. - Introduces throttled markdown parsing/sanitization and attempts to reduce timeline recomputation work during streaming deltas.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app-prefixable/src/pages/directory-layout.tsx | Reorders providers so EventProvider can consume events via SyncProvider. |
| app-prefixable/src/context/sync.tsx | Adds subscribe() for shared SSE event consumption and removes per-event logging. |
| app-prefixable/src/context/events.tsx | Removes its own SSE connection and consumes events through SyncProvider. |
| app-prefixable/src/components/message-timeline.tsx | Adds a “structure” memo intended to limit turn recomputation during text deltas. |
| app-prefixable/src/components/markdown.tsx | Throttles markdown parse/sanitize work during streaming updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Verification
Closes #445
Closes #446
Closes #447
Closes #448