Repository navigation
perf(flow-chat): incremental segment streaming reuse in explore group (OpCase-Explore-02) - #3798
Merged
wsp1911 merged 2 commits intoNov 14, 2026
Merged
Conversation
wsp1911
pushed a commit
to wsp1911/OpenBitFun
that referenced
this pull request
Nov 14, 2026
Keep changed segments immutable so suspended renders cannot alter callbacks retained by the committed view. Publish the reusable segment cache only after commit while preserving unchanged segment identities. Add append, replacement, and concurrent rendering regression coverage. All 23 focused tests and the Web UI type check pass. The broader Web UI check is blocked by an existing Dialog typography token violation. Refs: openBitFun#3798
wsp1911
pushed a commit
that referenced
this pull request
Nov 14, 2026
Keep changed segments immutable so suspended renders cannot alter callbacks retained by the committed view. Publish the reusable segment cache only after commit while preserving unchanged segment identities. Add append, replacement, and concurrent rendering regression coverage. All 23 focused tests and the Web UI type check pass. The broader Web UI check is blocked by an existing Dialog typography token violation. Refs: #3798
Closed
3 tasks done
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