Job logs grow without bound: recursive search of runtime logs consumed 152 GiB and filled disk
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- cli, observability
Hướng nghiên cứu
Start with internal/session/jobs.go, especially jobSink.Write and the newJob/claimJobLog path that creates job spools. Trace how stdout and stderr are written, then inspect existing job-related tests before defining coverage for bounded disk usage, truncation or rotation, error reporting, and recursive-search output. Done means sustained output and recursive searches remain bounded while child processes continue draining safely.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A recursive search launched by CodeAF consumed approximately 152.6 GiB across four job logs and kept growing until the laptop ran out of space. The search included CodeAF's own runtime log directory, so its output contained deeply nested copies of earlier search output. The disk spool has no size bound even though the in-memory output does.
Observed incident
- macOS arm64; CodeAF session workspace was
$HOME. - Logs under
$HOME/.codeaf/v3/projects/<project>/<session>/logs/jobs/:129.log: 64.49 GiB allocated, discovered during follow-up cleanup150.log: 46.07 GiB152.log: 27.67 GiB154.log: 13.62 GiB
- The initial size snapshot of
150.log,152.log, and154.logtotaled 87.36 GiB. By cleanup, those three had 88.11 GiB allocated; adding129.logbrings the four-log cleanup total to approximately 152.60 GiB. These are different observation times, not inconsistent totals. - Over a three-second observation,
150.log,152.log, and154.loggrew by approximately 3.0, 2.7, and 2.9 MiB respectively. - The laptop reached approximately 117 MiB free, and newly reclaimed cache/download space was being consumed again. An unrelated operation failed with
ENOSPC. - Three live recursive
grepprocesses were identified and terminated before log cleanup. No CodeAF daemon shutdown was needed to stop those processes. - A bounded 16 KiB tail sample from
154.logcontained 159 occurrences of/logs/jobs/; the nested matches repeatedly referenced129.logwith line-number prefixes. A separate 64 KiB tail preserved from129.logshows the same search phrase matched across CodeAF worktrees, stored task transcripts, runtime stubs, and fix records; that sample does not contain nested job-log prefixes or establish the original command that started it. Raw logs are omitted because they include local paths and unrelated user content.
One observed command, with the home path redacted:
grep -rn "git push is not yours to run" "$HOME/.codeaf" /usr/local /opt/homebrew 2> /dev/null
The nested output had this structure (schematic, path/session values removed):
$HOME/.codeaf/.../logs/jobs/129.log:<line>:$HOME/.codeaf/.../logs/jobs/129.log:<earlier-line>:...
This directly establishes that searches were re-ingesting CodeAF job output. A live search reading its own spool is a plausible feedback mechanism, but the preserved tail alone does not establish which process first entered that loop. Later searches also replayed already-amplified output.
Relevant implementation
Inspected source revision: 2d60ab4b3c4ecb70d51a1918d4384db24fd1fb0c (the installed development binary does not embed a usable revision, so this is not asserted to be its exact build).
internal/session/jobs.go,jobSink.Write: every chunk is written to the file without a byte budget or rotation; only the in-memory ring is bounded.- The same writer ignores file-write errors and always returns success, explicitly including a full disk. That protects the child process but gives no disk-spool failure signal through this writer.
newJob/claimJobLogcreates the spool that receives both stdout and stderr.
Expected behavior / proposed fix
- Bound disk output per job and across retained job logs. Preserve a useful tail and a clear truncation/rotation notice when a limit is reached, while continuing to drain child output safely.
- Surface logging failures such as disk exhaustion instead of silently treating the spool as complete.
- Prevent generated recursive searches from including CodeAF runtime/spool directories by default, especially when the workspace is
$HOME; intentional log inspection should be explicit and bounded. - Add a regression covering a command whose output matches a recursive search of its spool tree, plus a sustained-output case. Verify both disk usage and process cleanup stay bounded.
No large reproduction or test suite was run on the affected laptop. This report is based on the live process/file observations, a bounded log sample, and source inspection. Full acceptance tests for any fix must run on Spark per the owner's standing policy.
- Ngôn ngữ chính
- Go
- Star
- 115
- Fork
- 14
- Merge trung bình
- 9 giờ 35 phút
- Pull request đã merge (30 ngày)
- 752
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Agent-Field/CodeAF
-
area:chat bug sev:papercut
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Agent-Field/CodeAF#1592 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:headless bug sev:critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Agent-Field/CodeAF#1566 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tui3: slash command completion inserts bare command prefix into prompt instead of navigatingĐang mởarea:chat bug sev:critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent-Field/CodeAF#1548 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:chat feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Agent-Field/CodeAF#1510 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:tests bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent-Field/CodeAF#1489 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Agent-Field/CodeAF
Issue tương tự
-
area/proxy kind/bug priority/backlog triage/accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lexfrei/cloudflare-tunnel-gateway-controller#840 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 7 ngày
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P2 reliability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
afreidah/s3-orchestrator#1564 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
blinklabs-io/gouroboros#2577 ·
Maintainer thường phản hồi trong vòng 1 ngày