Repository navigation
perf: large threads open from a viewport snapshot, and typing and streaming render less - #18220
Open
maria-rcks wants to merge 240 commits into
Open
maria-rcks wants to merge 240 commits into
maria-rcks wants to merge 240 commits into
Conversation
# Conflicts: # apps/server/src/vcs/VcsStatusBroadcaster.test.ts # apps/web/src/components/CommandPalette.logic.ts # apps/web/src/components/CommandPalette.tsx # apps/web/src/components/CommandPaletteHost.tsx # apps/web/src/components/ThreadRouteView.tsx # apps/web/src/components/settings/SettingsFontPreviews.tsx
| FROM orchestration_v2_projection_turn_items AS item | ||
| JOIN orchestration_v2_projection_runs AS run ON run.run_id = item.run_id | ||
| WHERE item.thread_id = ${threadId} | ||
| AND item.type = 'user_message' |
Contributor
There was a problem hiding this comment.
🟡 Medium orchestration-v2/ProjectionStore.ts:3420
A viewport with one old user turn followed by many notification-driven wake runs includes every historical checkpoint, producing an unbounded checkpoint list. turn_starts filters to user_message rows, so those notification-started runs do not fill the raw-turn budget and the computed cutoff remains 0; include notification-started runs in this budget, as the timeline's run_starts does.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/server/src/orchestration-v2/ProjectionStore.ts around line 3420:
A viewport with one old user turn followed by many notification-driven wake runs includes every historical checkpoint, producing an unbounded checkpoint list. `turn_starts` filters to `user_message` rows, so those notification-started runs do not fill the raw-turn budget and the computed cutoff remains `0`; include notification-started runs in this budget, as the timeline's `run_starts` does.
# Conflicts: # apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts # apps/web/src/components/ChatView.tsx # apps/web/src/components/chat/ChatComposer.tsx
# Conflicts: # apps/desktop/src/app/DesktopObservability.test.ts # apps/desktop/src/app/DesktopObservability.ts # apps/mobile/src/connection/environment-cache-store.test.ts # apps/server/src/orchestration-v2/ProjectionStore.ts # apps/server/src/orchestration-v2/ProviderTurnStartService.ts # apps/server/src/ws.ts # apps/web/src/components/DiffWorkerPoolProvider.tsx # apps/web/src/components/Sidebar.tsx # apps/web/src/components/chat/ChatComposer.tsx # apps/web/src/components/files/FileBrowserPanel.tsx # apps/web/src/components/settings/KeybindingsSettings.tsx # apps/web/src/components/settings/SettingsFontPreviews.tsx # apps/web/src/connection/storage.ts # packages/client-runtime/src/state/threadHistoryMerge.ts
This branch has not been deployed
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.
stacked on #18219. this diff shows only this layer.
threads open from a viewport snapshot and fetch older history as needed. streamed text updates its own row, typing stays local to the editor, and unchanged timeline entries are reused. server activity updates patch sqlite fields and subscribers share encoded events; independent config discovery runs concurrently.
historical medians of five interleaved linux/chromium runs, 0db57d8 → 1634ef4, before trimming:
the later trim-only recheck measured largest-thread paint at 349.5 → 322 ms, with overlapping ranges. the historical table is not a fresh measurement of the integrated head.
model: claude-opus-5-5 coordinating gpt-6.1-sol subagents, harness: claude code in t3 code.