Skip to content

perf(server): skip shell refresh for streaming deltas#4009

Open
Chrrxs wants to merge 2 commits into
pingdotgg:mainfrom
Chrrxs:fix/skip-streaming-shell-summary
Open

perf(server): skip shell refresh for streaming deltas#4009
Chrrxs wants to merge 2 commits into
pingdotgg:mainfrom
Chrrxs:fix/skip-streaming-shell-summary

Conversation

@Chrrxs

@Chrrxs Chrrxs commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What Changed

Skip refreshThreadShellSummary for streaming assistant messages while preserving message projection and the thread updatedAt. Add a regression test that fails if this hot path reads thread activity history.

Why

Large threads can retain hundreds of MB of tool activity. Rebuilding the shell summary for every text delta made projection time proportional to the full thread history and throttled visible streaming to about one delta per second.

Fixes #4008.

This is the minimal shell-refresh subset of #2631; it does not change message repository APIs or persistence behavior.

UI Changes

No UI code changed; this fixes streaming timing.

T3.Code.Slow.TPS.FIXED.2026-07-15.101452.mp4

Testing

  • vp test apps/server/src/orchestration/Layers/ProjectionPipeline.test.ts (22 passed)
  • vp check (passes; 9 pre-existing warnings)
  • vp run typecheck
  • Reproduced and verified against the original affected thread

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Changes projection hot-path behavior so thread shell summary fields may lag during streaming until a non-streaming event refreshes them; scoped change with test coverage.

Overview
Streaming assistant deltas no longer trigger a full thread shell summary rebuild on each thread.message-sent projection. The threads projector still bumps updated_at, but it skips refreshThreadShellSummary when the event is an assistant message with streaming: true, avoiding repeated scans of messages, activities, and pending approvals on every text chunk.

A regression test seeds invalid activity JSON for the thread and projects a streaming assistant delta; if the hot path reads activity history, projection fails. It also asserts the streamed message and thread timestamp still update correctly.

Reviewed by Cursor Bugbot for commit 69d5c69. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Skip shell summary refresh for streaming assistant messages in projection pipeline

When processing a thread.message-sent event where the role is assistant and the message is marked as streaming, the projector in ProjectionPipeline.ts now skips the shell summary refresh. The thread updated_at is still updated. A new test verifies no historical activity scan occurs during streaming delta handling.

Macroscope summarized 69d5c69.

Streaming assistant messages still update their message projection and thread timestamp, but no longer rebuild the full thread shell summary for every delta. Add a regression test that fails if the hot path reads activity history.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0e60cad3-1893-46d1-b51f-64bd6fd523e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Jul 15, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

A small, well-tested performance optimization that conditionally skips shell summary refresh for streaming assistant message deltas. The change is self-contained with clear intent and comprehensive test coverage.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Streaming assistant deltas rescan full thread activity history

2 participants