A headless run hashes every untracked file by loading it whole
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- git, go
- 领域
- cli, performance, testing
调研方向
Start in internal/session/run_tree_changes.go at SnapshotRunTree and runTreeDigest, then inspect the existing digest handling for permissions, links, missing paths, and unreadable files. Add coverage for large untracked files and digest equivalence across sizes and edge cases; done means codeaf do --json reports no change for an untouched artifact while peak memory stays bounded.
由索引模型根据 Issue 内容生成。
描述
Found on santos/dev2 at 008363c98 (#1410). It reaches dev when #1410 merges.
What happened
codeaf do snapshots changed and untracked paths before a run and compares them afterward. For each regular file, it uses os.ReadFile to compute a digest. A large untracked artifact is therefore allocated whole, twice, even when the run never touches it. The issue is resource use; no incorrect file result was observed.
Replication
Deterministic (no model). In internal/session, make a temporary Git repository with one large untracked file, call SnapshotRunTree, then Changed without editing that file. Measure peak allocation with a size larger than the test process's ordinary heap. Today each pass reads the complete file. The returned changed list is empty.
Field (real models). Place a large untracked build artifact in a throwaway repository and invoke codeaf do --json there with OPENROUTER_API_KEY and deepseek/deepseek-v4-flash. Budget a minute and a small charge; compare peak memory with the same repository without the artifact.
Where
internal/session/run_tree_changes.go:40, SnapshotRunTree, enumerates --untracked-files=all; runTreeDigest at :196 calls os.ReadFile for each regular file.
The fix
Stream each file into SHA-256 with a bounded buffer. Preserve the existing digest semantics for permissions, links, missing paths and unreadable files.
Acceptance
- e2e:
codeaf do --jsonin a repository with a large untouched untracked file reports no change to that path and keeps peak memory bounded independently of its size. - Unit: streaming and current digests match across file sizes and edge cases.
- Document any changed limit and add an
invalidatesentry.
- 主要语言
- Go
- 星标
- 115
- 派生
- 14
- 平均合并
- 9 小时 38 分钟
- 30 天内合并 PR
- 749
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Agent-Field/CodeAF 的其他 Issue
-
area:chat feature
难度 2/5 1-3 小时 新手友好度 88/100
Agent-Field/CodeAF#1510 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
Agent-Field/CodeAF#1489 ·
维护者通常 1 天内回复
-
area:chat bug good first issue sev:papercut
难度 2/5 1-3 小时 新手友好度 78/100
Agent-Field/CodeAF#1470 ·
维护者通常 1 天内回复
-
area:chat bug good first issue sev:papercut
难度 2/5 1-3 小时 新手友好度 85/100
Agent-Field/CodeAF#1469 ·
维护者通常 1 天内回复
-
area:chat bug sev:papercut
难度 2/5 1-3 小时 新手友好度 88/100
Agent-Field/CodeAF#1468 ·
维护者通常 1 天内回复
查看 Agent-Field/CodeAF 的全部 Issue
相似的 Issue
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug P2 reliability
难度 2/5 1-3 小时 新手友好度 88/100
afreidah/s3-orchestrator#1564 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
blinklabs-io/gouroboros#2577 ·
维护者通常 1 天内回复
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复