perf: send only tail diff of streaming response to renderer#3324
perf: send only tail diff of streaming response to renderer#3324RyanGroch wants to merge 4 commits intodyad-sh:mainfrom
Conversation
Replace the full `streamingContent` IPC payload with a `streamingPatch`
of `{offset, content}` — the renderer reconstructs as
`current.slice(0, offset) + content`. `cleanFullResponse` may rewrite
earlier bytes inside in-progress dyad-tag attribute values, so the
sender computes `offset` as the longest common prefix length rather
than assuming pure appends.
Also memoize the per-piece markdown and custom-tag renderers so
completed segments skip ReactMarkdown's re-parse on every chunk.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@BugBot run |
🔍 Code Review Summary (Codex)Verdict: ✅ YES - Ready to merge ✅ No significant issues found. Generated by Codex |
There was a problem hiding this comment.
Code Review
This pull request optimizes chat streaming performance by reducing IPC overhead and React rendering costs. It introduces a tail-patching mechanism for streaming updates, where only the changed portion of a message is sent to the renderer based on the longest common prefix. Additionally, it implements memoization for markdown and custom tag components in the UI to prevent redundant parsing and rendering of completed message segments during active streams. I have no feedback to provide as there were no review comments to evaluate.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d953a5464
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
🔍 Dyadbot Code Review SummaryVerdict: 🤔 NOT SURE - Potential issues Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard. Issues Summary
🟢 Low Priority Notes (3 items)
🚫 Dropped False Positives (2 items)
Generated by Dyadbot multi-agent code review |
|
@BugBot run |
🔍 Code Review Summary (Codex)Verdict: ✅ YES - Ready to merge ✅ No significant issues found. Generated by Codex |
🔍 Dyadbot Code Review SummaryVerdict: ✅ YES - Ready to merge Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard. Issues Summary
🟢 Low Priority Notes (5 items)
🚫 Dropped False Positives (5 items)
Generated by Dyadbot multi-agent code review |
|
@BugBot run |
🔍 Code Review Summary (Codex)Verdict: ✅ YES - Ready to merge ✅ No significant issues found. Generated by Codex |
��� Dyadbot Code Review SummaryVerdict: ✅ YES - Ready to merge Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard. Issues Summary
🟢 Low Priority Notes (4 items)
🚫 Dropped False Positives (5 items)
Generated by Dyadbot multi-agent code review |
|
@BugBot run |
🔍 Code Review Summary (Codex)Verdict: ✅ YES - Ready to merge ✅ No significant issues found. Generated by Codex |
🔍 Dyadbot Code Review SummaryVerdict: ✅ YES - Ready to merge Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard. Issues Summary✅ No HIGH or MEDIUM issues found. 🟢 Low Priority Notes (1 item)
🚫 Dropped False Positives (13 items)
Generated by Dyadbot multi-agent code review |
🎭 Playwright Test Results❌ Some tests failed
Summary: 290 passed, 1 failed, 3 flaky, 6 skipped Failed Tests🍎 macOS
📋 Re-run Failing Tests (macOS)Copy and paste to re-run all failing spec files locally: npm run e2e \
e2e-tests/custom_apps_folder.spec.ts
|
Replace the full
streamingContentIPC payload with astreamingPatchof{offset, content}— the renderer reconstructs ascurrent.slice(0, offset) + content.cleanFullResponsemay rewrite earlier bytes inside in-progress dyad-tag attribute values, so the sender computesoffsetas the longest common prefix length rather than assuming pure appends.Also memoize the per-piece markdown and custom-tag renderers so completed segments skip ReactMarkdown's re-parse on every chunk.