Skip to content

perf(control): finish streaming and virtualization overhaul#456

Merged
Th0rgal merged 2 commits into
masterfrom
fix/goal-termination-final-message-fallback
May 19, 2026
Merged

perf(control): finish streaming and virtualization overhaul#456
Th0rgal merged 2 commits into
masterfrom
fix/goal-termination-final-message-fallback

Conversation

@Th0rgal

@Th0rgal Th0rgal commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • finish the remaining /control perf overhaul items: chat/thought virtualization, slice stores, worker replay reducer, inactive delta summarization, WS streaming, negotiated text_op deltas, canonical assistant rows, and @Perf Playwright coverage
  • document the updated streaming contract and final PERF_OVERHAUL status/measurements
  • keep fresher Grok workspace OAuth tokens instead of overwriting them with stale host auth

Local validation

  • cargo fmt --all
  • cargo check -q
  • cargo test -q text_op_stream_transform --lib
  • cargo test -q inactive_stream_summary --lib
  • cargo test -q finalized_text_ops_collapse_to_canonical_assistant_row --lib
  • cd dashboard && npx tsc --noEmit
  • cd dashboard && bun run build
  • cd dashboard && PLAYWRIGHT_PORT=3001 PLAYWRIGHT_BASE_URL=http://localhost:3001 bunx playwright test tests/control-perf.spec.ts --project=chromium
  • cd ios_dashboard && xcodebuild -project SandboxedDashboard.xcodeproj -scheme SandboxedDashboard -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.4' build

Deploy / iOS smoke

  • redeployed sandboxed-sh-dev after backend changes and verified /api/health
  • simulator rendered historical goal fixture and connected SSE state against dev backend

Note

Medium Risk
Medium risk because it changes the /control streaming transport contract (adds WebSocket + negotiated text_op) and introduces new client-side execution paths (virtualized lists and a Web Worker) that could affect real-time rendering and history replay behavior.

Overview
Completes the remaining /control perf overhaul items by virtualizing the transcript/thoughts UI (via @tanstack/react-virtual) and offloading large history replays to a new events-worker.ts Web Worker with a synchronous fallback.

Updates the streaming contract documentation to include a WebSocket transport (/api/control/ws) and capability-negotiated text_op deltas plus finalized canonical assistant rows, and refreshes the perf log/measurements and local validation commands.

Adds perf regression coverage by introducing an @perf Playwright test (control-perf.spec.ts) that loads a large fixture mission and asserts DOM/heap/longtask budgets, and makes Playwright’s baseURL/port configurable via env vars.

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

@vercel

vercel Bot commented May 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sandboxed-dashboard Ready Ready Preview, Comment May 19, 2026 9:46am
sandboxed-sh Ready Ready Preview, Comment May 19, 2026 9:46am

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e8cbb30. Configure here.

command: 'bun dev --port 3099',
url: 'http://localhost:3099',
command: `bunx next dev --port ${port}`,
url: baseURL,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playwright port/baseURL mismatch when only one env var set

Medium Severity

When PLAYWRIGHT_BASE_URL is set without PLAYWRIGHT_PORT (e.g. PLAYWRIGHT_BASE_URL=http://localhost:3001), port defaults to '3099', so webServer.command starts Next on 3099 while webServer.url polls 3001. The test run will hang waiting for a server that never appears on the expected port. Deriving port from the URL, or requiring both vars together, would fix this.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e8cbb30. Configure here.

@Th0rgal Th0rgal merged commit 15ced0c into master May 19, 2026
13 checks passed
@Th0rgal Th0rgal deleted the fix/goal-termination-final-message-fallback branch May 19, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant