🤖 perf: throttle sub-agent projection refetches after usage-changed events
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend, performance
调研方向
Start from the store code that refetches the open sub-agent projection on each usage-changed event, and from the getSubagentUsage call it makes. The issue names no files, so find them by searching for those identifiers. Add a per-ancestor trailing-edge throttle of about 1 s, or a backend view cache, then rerun the 200-writes-at-20/s benchmark with the parent shown and report fetch counts and CPU before and after. The second note, about the settling stream's ledger refetch double counting, needs a design decision first.
由索引模型根据 Issue 内容生成。
描述
After #7867, the store refetches the open sub-agent projection once per usage write for each ancestor shown on screen (single flight, no delay). An independent verifier measured the cost for a large tree:
- One
getSubagentUsagefor 107 open sub-agents costs about 29 ms of server CPU (11 ms on the main thread). - 200 headless writes at 20/s with the parent shown cost 200 fetches and 9.16 s of server CPU over 11.6 s, against 2.10 s with the parent not shown.
- The estimate is 11-22% of the backend main thread per window showing a large root at 10-20 usage events/s, about 30-60× more fetches than before #7867.
Fix: a per-ancestor minimum interval between projection fetches (about 1 s, trailing edge, so the last change always lands), or a per-sub-agent view cache on the backend. Acceptance: rerun the 200-writes-at-20/s benchmark with the parent shown, report fetches and CPU before and after, and keep totals exact.
A second note from the same verifier: a workspace's own headless spend (bash AI proxy, status titles) now shows only when that workspace's own stream ends. The store skips its own ledger refetch during its own stream to avoid counting the stream twice. The final total is correct. Fixing this needs a refetch that cannot double count the settling stream.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- 主要语言
- TypeScript
- 星标
- 2.1k
- 派生
- 139
- 平均合并
- 5 小时 5 分钟
- 30 天内合并 PR
- 923
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/xum 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
🤖 fix: xum api exits 0 when a procedure returns success: false可能已有人在做 @twotnguyen 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
bug:unconfirmed
难度 2/5 1-3 小时 新手友好度 68/100
Heroic-Games-Launcher/HeroicGamesLauncher#6062 ·
维护者通常 1 天内回复
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 67/100
Richard-Zhang1019/Crossbow#431 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 63/100
EKKOLearnAI/ekko-studio#3761 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 67/100
ruyd/agentic-sdlc-lab#4 · 2 条评论 ·