Repository navigation
Conversation
…f-window running messages, and dedupe history pages
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Compacts thread snapshots, history pages and live updates while retaining legacy transport support and detail retrieval. The changes affect wire representations rather than stored data or provider execution, with no obvious material risk requiring human review. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosNo All 64 scenario measurements
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Opening a thread with an active long turn sends hundreds of kilobytes of off-window historical messages (~196 KB on
longTurnRunningColdOpen), ~55-fieldproviderSession.capabilitiesobjects (when clients read only a small subset), redundantvisibleTurnItemslocal wrappers (~18–24 KB on 150-row opens), full server-internal refs (nativeItemRef,nativeThreadRef,nativeConversationHeadRef,nativeTurnRef,claudeDeliveredAppContext), unstripped checkpoint item file lists, unbounded subagent previews, and un-deduped history pages.Stacked cleanly on #48441 (
nbr/stream-deltas), this adds opt-incompactWire(cw: 1) encoding, off-window active-run message pruning, and history-page body deduplication transparently across web, desktop, and mobile (client-runtime), keeping legacy clients and servers 100% compatible:withRecordIdTable+cw: 1): Unwraps localvisibleTurnItemsrows to bare turn items (while still interning all IDs), omits null/default fields and redundant timestamps, and compactsproviderSessions[].capabilitiesto non-default client-read flags.ProjectionStore): Prunes completed off-window assistant messages on running turns while preserving visible-window messages, streaming messages, active/queued user prompts, latest run replies,delegatedCompletion,workflowScript, and provider-native subagent prompts.WireProjection): Strips server-only native refs/metadata (retaining all client-inspected refs), blanks unused checkpoint turn-itemfilesarrays (keepingfilesTotalandprojection.checkpoints[].files), and bounds subagent preview strings to UI display limits.dedupeBodies=1,compactIds=1, andcompactWire=1on history pages,getThreadProjection, andlaunchThread.Measured
transferBudgetV2Wire Reductionsmain)nbr/thread-snap-opt)long turn running, cold openlong turn running, cold openlong turn finished, cold openlong turn finished, cold openstale todo list cold openstale todo list cold openreconnect, thread (snapshot)Verification
vp run check:changed: pass (format,lint,knip,graphql,typecheckacross 39 packages, 19 test files / 308 tests includingorchestrationV2CompactWire.test.ts,orchestrationV2DedupedBodies.test.ts,threadHistoryPaging.test.ts,WireProjection.test.ts,http.test.ts,boundedThreadSnapshotHttp.test.ts,threadHistoryHttp.test.ts,commands.test.ts, andtransferBudgetV2.integration.test.ts).Created with Gemini 4 Neon in Antigravity.