Opening a long thread still takes 9–12 s on main, and each older page 3–4 s (follow-up to #24895)

未关闭
#36,128 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@juliusmarminge 已经在做这个了。

开始于 2026年11月13日。

  • #36141 来自 @juliusmarminge —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
node.js, sqlite, typescript

调研方向

Start by reading getThreadSnapshotWindow and getThreadHistoryPage in apps/server/src/orchestration-v2/ProjectionStore.ts and the query plan behind each; the #29468 comment links the covering-index approach the local build uses. Check the open pull request #36141 before touching anything, since it may already cover this work. Reproducing needs the 49 GB statev2.sqlite clone read through the real reader worker, so confirm you can get a comparable dataset first. Done looks like thread-open and older-page timings on main approaching the local-build numbers, with a query plan showing payloads are no longer decoded for run and attempt metadata.

由索引模型根据 Issue 内容生成。

描述

#24895 and #20427 were closed on November 11. On main at a044f0c0b3, opening our two coordinator threads and paging back still takes:

Read Thread A / B on main Our local build
Thread open: getThreadSnapshotWindow 11.0–11.6 / 9.1–9.8 s 3.7–4.9 s
Each older page: getThreadHistoryPage 3.0–4.2 / 2.9–3.6 s 1.0–2.1 s

Setup: a block clone of our 49 GB statev2.sqlite, read through the real ProjectionStore (reader worker, node:sqlite), read-only, two passes. Thread A has 7,352 runs and 62,950 turn items, thread B 6,886 runs and 59,668. Our local build was measured on the same clone earlier.

Where the time goes on thread A, second pass:

  • Thread open, 10.8 s:

    • the recursive retained-node read, 3.2 s;
    • checkpoints, 2.3 s;
    • provider turns, attempts and runs, 1.0–1.1 s each;
    • subagents and context transfers, 0.9 s each.

    The live-or-recent reads (status IN (...) OR ...) still take about a second each on a thread with 7,000 runs.

  • Each older page, 3.2 s: all runs, 1.1 s, and all attempts, 1.1 s, are read to render one page. A count of the earlier items takes another 0.4 s.

Our build takes a page's run and attempt metadata from covering indexes instead of decoding every payload. The #29468 comment links the code. Every thread switch to a long thread pays the open cost, and every scroll back pays the page cost.

Measured and written by Claude (Opus 5.5) in T3 Code; posted with the owner's approval.

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
59 分钟
30 天内合并 PR
418

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。