Repository navigation
perf(desktop): make session data flow incremental and bounded #2913
Description
Activity
English
Progress update
- perf(runtime-host): replace transcript snapshots with bounded pages #2922 merged the bounded transcript paging/bootstrap protocol while preserving the simple CLI/TUI materialization API.
- perf(desktop): keep transcript state incremental #2937 merged the Desktop Main sparse replica, bounded incremental Main-to-Renderer delivery, automatic earlier-history prefetch, sampled prompt navigation, and incremental recovery/settlement paths.
- The tracker now marks Phases 0–2 complete.
- The next implementation phase is real transcript DOM virtualization and bounded materialization around navigation/search targets. The later catalog/startup, streaming sanitization, and Host-side search phases remain unchanged.
The merged work has green CI and was smoke-tested in Electron with a long session.
Posted by Codex on behalf of the maintainer.
中文
进度更新
- perf(runtime-host): replace transcript snapshots with bounded pages #2922 已合并有界 transcript paging/bootstrap protocol,同时保留了简单的 CLI/TUI 完整物化 API。
- perf(desktop): keep transcript state incremental #2937 已合并 Desktop Main sparse replica、有界的 Main-to-Renderer 增量交付、自动向上预取历史、采样式 prompt 导航,以及增量 recovery/settlement 路径。
- 跟踪正文现已将 Phase 0–2 标记为完成。
- 下一阶段是真正的 transcript DOM virtualization,以及围绕导航/搜索目标进行有界物化。后续 catalog/startup、streaming sanitization 和 Host-side search 阶段保持不变。
已合并内容的 CI 全绿,并已在长会话上完成 Electron 实机 smoke test。
由 Codex 代表维护者发布。
English
Current status (2026-08-24)
Fresh check against live
mainat3bb645e9958a25986cb4502e8fbced5659b9ce8e:- perf(runtime-host): replace transcript snapshots with bounded pages #2922 and perf(desktop): keep transcript state incremental #2937 are merged. The Desktop Main sparse transcript replica and bounded incremental IPC are in place.
- Transcript virtualization is now substantially landed:
use-turn-virtualizer.tsprovides a bounded viewport window, geometry tracking, overscan, spacers, and scroll anchoring;ChatViewrenders the mounted window and usesloadAroundfor targeted loading. - This means Phase 3 is partially complete, but the issue is not closed: transcript search is not yet Host-indexed, and copy-all/export is not yet proven to read the complete data model rather than the currently loaded sparse window.
The following work remains open:
- Phase 4 — catalog, Sidebar, and startup: the renderer still uses a full
sessions.list()refresh for catalog updates; session events can trigger that refresh; the Sidebar still maps the complete catalog without flattened-row virtualization; and React startup still waits for the onboarding/session snapshot. - Phase 5 — streaming: bounded stateful cross-delta redaction exists, but provider-delta batching, safe chunks/rope storage, and the one-React-publish-per-frame path are not complete.
- Phase 6 — Host search and Workbar: thread search still performs the remote per-session
listSessions()→openSession()→loadTranscript()pattern; no Host-local bounded search operation is present. Inactive Workbar tabs remain mounted rather than being suspended/unmounted after a grace period. - Phase 3 follow-through: complete-data-model copy/export, Host/index-backed search jumps, accessibility validation, and the final Electron performance evidence still need closure.
Evidence paths on the checked-out main:
use-turn-virtualizer.tsruntime-host-search-ipc-main.tsuse-app-shell-session-list.tsworkbar-surface.tsx
Recommendation: keep #2913 open as the incremental Desktop umbrella. Update the Phase 3 checklist to distinguish the landed bounded transcript window from the remaining search/export/accessibility/performance work; keep Phases 4–6 open until their end-to-end gates pass.
中文
当前状态(2026-08-24)
基于 live
main的3bb645e9958a25986cb4502e8fbced5659b9ce8efresh check:- perf(runtime-host): replace transcript snapshots with bounded pages #2922 和 perf(desktop): keep transcript state incremental #2937 已合并,Desktop Main sparse transcript replica 与有界增量 IPC 已落地。
- transcript virtualization 已基本落地:
use-turn-virtualizer.ts提供有界 viewport window、geometry tracking、overscan、spacer 和 scroll anchoring;ChatView渲染有界窗口,并通过loadAround定点加载。 - 因此 Phase 3 部分完成,但 issue 还不能关闭:transcript search 还没有 Host index,copy-all/export 也还没有证明使用完整 data model,而不是当前已加载的 sparse window。
仍待完成:
- Phase 4 — catalog、Sidebar、startup: renderer 仍使用完整
sessions.list()刷新 catalog;session 事件仍可能触发该刷新;Sidebar 仍映射完整 catalog,未做 flattened-row virtualization;React 启动仍等待 onboarding/session snapshot。 - Phase 5 — streaming: 有界的跨 delta stateful redaction 已存在,但 provider-delta batching、safe chunks/rope 存储及每帧最多一次 React publish 尚未完成。
- Phase 6 — Host search 与 Workbar: thread search 仍采用远程逐 session 的
listSessions()→openSession()→loadTranscript()路径;尚无 Host-local bounded search operation。inactive Workbar tab 仍保持 mounted,没有在 grace period 后暂停/卸载。 - Phase 3 后续闭环: 完整 data model 的 copy/export、Host/index 支持的 search jump、accessibility 验证和最终 Electron 性能证据仍待完成。
建议:保留 #2913 作为增量 Desktop umbrella issue。更新 Phase 3 checklist,区分已落地的有界 transcript window 与仍待完成的 search/export/accessibility/performance;Phase 4–6 在端到端 gate 通过前继续保持 open。
- added a commit that references this issue
on Sep 1, 2026 - added a commit that references this issue
on Sep 1, 2026 - added a commit that references this issue
on Oct 11, 2026
English
Problem
Desktop session work currently scales with total history instead of the amount of change:
The storage layer already has a durable append-only
(session_id, sequence)primary key for session messages. We can use that sequence directly as the transcript watermark; no historical data migration or new transcript revision is required.Desired outcome
Make Desktop a bounded incremental client:
Non-negotiable properties:
Proposed implementation
1. Replace the transcript snapshot protocol — completed in #2922
{sequence, message}.subscription.open, so continuity plus the latest messages arrive in one RTT.session.transcript.pageoperation for older/newer ranges.subscription.transcript_advancedwatermark frame; clients pull the changed durable range instead of receiving large messages through the subscription queue.session.transcript.query,TranscriptSnapshotStore, the 16 MiB total snapshot limit, snapshot-expiry recovery, and the one-message-per-request assembler.This is a direct protocol replacement. Desktop and its Runtime Host communication layer ship together, so no v1/v2 capability negotiation or fallback is needed.
2. Preserve a simple CLI/TUI API — completed in #2922
loadTranscript(): Promise<Message[]>as a shared client convenience API implemented over the new pages.The CLI/TUI UI does not need to be rewritten as part of the Desktop work.
3. Add a Desktop Main sparse transcript replica — completed in #2937
sessions:readMessages -> Message[]with window/page/patch IPC.4. Implement real transcript virtualization
loadAround(sequence).content-visibilityonly as a window-local optimization.5. Incremental session catalog, Sidebar, and startup
The existing
session.catalog.changedframe already carries a session ID, so it can drive a targetedsession.catalog.query({kind: "get"}).SessionNavRow.6. Make streaming sanitization incremental
Cross-delta redaction must not be weakened for performance.
7. Move thread search to the Host and gate inactive Workbar views
Validation
Cover at least:
loadTranscript()equivalence with durable storage;Suggested initial regression budgets:
subscription.openround tripDelivery order
Non-goals
content-visibilityas virtualization.Prepared by Codex under maintainer direction after a read-only audit of current main. The maintainer owns the final technical decisions and implementation.
中文
问题
当前 Desktop 的 session 工作量随完整历史增长,而不是随实际变化量增长:
存储层已经为 session messages 提供持久、append-only 的
(session_id, sequence)主键。可以直接使用该 sequence 作为 transcript watermark,不需要迁移历史数据,也不需要新增 transcript revision。目标结果
将 Desktop 改造成有界的增量客户端:
不可妥协的约束:
建议实现
1. 替换 transcript snapshot protocol — 已由 #2922 完成
{sequence, message}storage page API。subscription.open中加入可选 tail bootstrap,让 continuity 与最新消息通过一次 RTT 返回。session.transcript.pageoperation,用于读取 older/newer ranges。subscription.transcript_advancedwatermark frame;client 主动拉取变化的 durable range,不通过 subscription queue 推送大消息。session.transcript.query、TranscriptSnapshotStore、16 MiB transcript 总量上限、snapshot-expiry recovery 和 one-message-per-request assembler。这是一次直接 protocol replacement。Desktop 与其 Runtime Host 通信层同步发布,因此不需要 v1/v2 capability negotiation 或 fallback。
2. 保留简单的 CLI/TUI API — 已由 #2922 完成
loadTranscript(): Promise<Message[]>作为共享 client 的 convenience API,内部使用新 page protocol。本轮 Desktop 优化不要求重写 CLI/TUI 界面。
3. 增加 Desktop Main sparse transcript replica — 已由 #2937 完成
sessions:readMessages -> Message[]。4. 实现真正的 transcript virtualization
loadAround(sequence)跳转。content-visibility只作为窗口内优化。5. 增量 session catalog、Sidebar 和 startup
现有
session.catalog.changedframe 已经携带 session ID,因此可以直接触发一次定点的session.catalog.query({kind: "get"})。SessionNavRow中嵌套的 interactive button。6. 将 streaming sanitization 改为增量处理
不能为了性能削弱 cross-delta redaction。
7. 将 thread search 移到 Host,并限制 inactive Workbar views
验证
至少覆盖:
loadTranscript()与 durable storage 的内容等价;建议的初始 regression budgets:
subscription.openround trip交付顺序
非目标
content-visibility代替 virtualization。本内容由 Codex 在维护者指示下、基于当前 main 的只读审计整理。最终技术决策与实现由维护者负责。