read_file slurps and splits entire files before applying line limits, risking memory exhaustion and stale running calls
Maintainer thường phản hồi trong vòng 1 ngày
@prudhvirajkonda8-bot đang làm issue này rồi.
Từ ngày 15/11/2026.
- #704 của @prudhvirajkonda8-bot — đang mở
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 15/100
Hướng nghiên cứu
Start with the text-read path in src/eca/features/tools/filesystem.clj around lines 178-206, where the whole file is slurped and split before line_offset and limit apply. Then check the batch execution path in src/eca/features/chat/tool_calls.clj and the native handler boundary in src/eca/features/tools.clj, which the issue links for the lifecycle concern. Done means a five-line prefix read uses bounded memory regardless of file size, oversized single lines are rejected, and every executing call gets a terminal notification.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Source finding
In ECA 0.170.5 (commit 4a65f8241b2a671fb03230fa4d7de9066e7d8b2f), read_file runs (string/split-lines (slurp ...)) before applying line_offset/limit.
Measured by source inspection, not a runtime benchmark: filesystem.clj:178–206, especially line 193, reads and splits the entire input before selecting the excerpt, and counts all lines for the truncation footer. The text-read path has no file-size guard or deadline.
Inferred consequence: requesting five lines still attempts whole-file allocation. Neither the line limit nor downstream output truncation bounds input allocation. A ~2.5 GB growing JSONL file motivated this report. No controlled large-file runtime reproduction or latency/RSS benchmark has been performed for this report; OOM, GC pressure, exact concurrency, and the cause of any stale running entries have not been established.
Reproduction to run in isolation
Invoke read_file with line_offset: 0 and limit: 5 against a large synthetic text file in a disposable process with external time and memory limits. Source inspection shows that the current handler still reads/splits the whole input; this proposed runtime reproduction has not been run for this report.
Expected behavior
Bounded streaming prefix reads with an enforced byte/line budget and a safe error for oversized single lines; no full scan just to report total lines. Consider an unknown-total truncation footer.
Related lifecycle hardening (source-inferred, not reproduced)
The inspected batch execution path starts batch futures before untimed joins. The native handler boundary catches Exception, while the join catches Throwable. An exceptional future exit before execution-end may omit the normal terminal notification. This is a code-path inference, not an observed allocation failure. Please add lifecycle regression coverage alongside bounded-read tests; this does not imply fatal VM errors are safe to recover from.
The optional agent timeout requests a stop, rather than enforcing a native-read memory budget; see also the timeout wait path.
Suggested acceptance checks
- A five-line prefix read has comparable memory use with 200 MB and 500 MB unused suffixes.
- An oversized single line cannot bypass the budget.
- Cancellation closes resources.
- Every executing call obtains a terminal notification or explicit session failure.
- Ngôn ngữ chính
- Clojure
- Star
- 1k
- Fork
- 82
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 22
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: 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 editor-code-assistant/eca
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
editor-code-assistant/eca#717 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Models doesn't work when fetchModels: false is usedCó thể làm lại được @zikajk đã nhận 36 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
editor-code-assistant/eca#661 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
editor-code-assistant/eca#716 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add delete_file toolĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
editor-code-assistant/eca#708 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
editor-code-assistant/eca#706 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của editor-code-assistant/eca
Issue tương tự
-
unshaved-yak
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
.Needs Triage .Team/UXWest Misc/Accessibility Priority:P3 Type:New Feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
metabase/metabase#88153 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
nasa/Common-Metadata-Repository#2544 ·
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 76/100