Repository navigation
perf(flow-chat): incremental segment streaming reuse in explore group (OpCase-Explore-02) - #3798
Open
Raing5Days wants to merge 2 commits into
Open
Raing5Days wants to merge 2 commits into
Raing5Days wants to merge 2 commits into
Conversation
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
Optimize explore-group and tool collection segment rendering during active streaming ingress (
FlowGroupRendererandbuildFlowGroupRenderSegments), preserving closed segment identities and height estimates on append.previoussegment slice inbuildFlowGroupRenderSegmentsto reuse the longest unchanged prefix of closed segments verbatim, eliminating fullFlowGroupRenderer'srenderSegmentsmemo through a ref trackingprevSegmentsRef, preventing downstream segment maps and virtualized DOM wrappers from needlessly re-rendering for settled historical tool runs.flowGroupRenderSegments.test.tsverifying that closed segment references are preserved across item appends.Type and Areas
Performance / refactoring. Web UI FlowChat collection grouping & rendering (
src/web-ui/src/flow_chat/components/modern/flowGroupRenderSegments.tsandsrc/web-ui/src/flow_chat/components/modern/FlowGroupRenderer.tsx). No wire protocol, persisted schema, or user-facing copy changes.Motivation / Impact
When an exploration group runs numerous tools (e.g. 30–50+ commands or file reads) while streaming live stdout/tokens at the tail:
estimateFlowGroupItemsHeightacross dozens of completed tools and allocating new segment objects.With incremental prefix reuse:
Verification
node scripts/run-vitest.mjs run --maxWorkers=50% "src/flow_chat/components/modern/flowGroupRenderSegments.test.ts"— 2 passed (100%).node scripts/run-vitest.mjs run --maxWorkers=50% "src/flow_chat/components/modern/FlowGroupLifecycle.test.tsx" --environment jsdom— 18 passed (100%).node .perf-harness/perf-agent-runner.mjs --case OpCase-Explore-02— passed: true, reuseRatio: 0.95, p95: 0.28ms.git diff --check— clean, no whitespace or formatting defects.Checklist