git_show redacts the whole patch once per file header, on unbounded output
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- performance, tooling
Hướng nghiên cứu
Start with internal/agent/tools/git.go at patchFile and the redaction loop, then trace how internal/gitx/gitx.go buffers Show output and how internal/agent/tools/tools.go limits the final result. Check existing tests around git_show and redaction first. Done means output is size limited, each file section is redacted once with cancellation checks, and a 1,000 file commit test completes within a bounded time.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The git_show tool runs a full redaction pass over the entire git show output for every ---/+++ header in it, on output that is not bounded, to produce at most 24 KB. A commit that touches many files stalls the run.
Where
internal/agent/tools/git.go:122(patchFile)internal/agent/tools/git.go:155-167(loop ofredact.ApplyInover the whole output)internal/gitx/gitx.go:366,:549(Showoutput buffered without a limit)internal/agent/tools/tools.go:250-258(finishredacts again and cuts to 24,000 bytes)
Details
gitx.Show returns the whole git show --stat --patch <rev> output. The tool then loops over every header and calls redact.ApplyIn(file, out) on the entire output each time. A modified file has both headers, so the same name is applied twice. Each call is a full scan: a lower-cased copy of the text, every gated regular expression, the remembered-value search and a rebuilt string. The loop does not check the context. Cost is O(H x S) for H header lines and S patch bytes.
Impact
An investigator, reviewer, prover or fixer that calls git_show on a commit touching many files (an initial commit, a vendoring or formatting commit, a large merge) stalls. Estimate, not measured: 1,000 changed files with a 5 MB patch is about 2,000 passes over 5 MB, many minutes for one tool call. The wall-time cap is only checked between model calls, so it does not interrupt this. git_log lists such commits by default.
Steps to reproduce
- In a repository whose latest commit adds about 1,000 text files, run an agentic scan.
- Have the model call
git_showwith that commit's hash and nopath. - The tool call does not return for minutes while one core is busy in redaction.
Suggested fix
Bound the output first (read git show through a limit of a few MB, since only 24 KB is ever returned). Then redact each file's section once with its own name: split on diff --git boundaries and call ApplyIn(file, section) per section, which is O(S) in total. Check ctx.Err() between sections.
Acceptance criteria
-
git showoutput is read through a size limit - Each file section is redacted once, with its own file name
- The loop honors cancellation
- A test with a 1,000-file commit returns in bounded time
Getting started
- Relevant files: internal/agent/tools/git.go, internal/agent/tools/tools.go, internal/gitx/gitx.go
- How to run tests:
make test-short(Unix) or.\make.ps1 test-short(Windows PowerShell);make lintbefore you call it done - Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at 50e92ec. Severity: medium. Effort: S. audit-key: performance|internal/agent/tools/git.go|gitShowTool
- Ngôn ngữ chính
- Go
- Star
- 0
- Fork
- 1
- Merge trung bình
- 8 giờ 14 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 TMHSDigital/Spackle
-
ci good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
TMHSDigital/Spackle#206 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Spackle#205 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/Spackle#199 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
TMHSDigital/Spackle#195 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue severity: medium
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
TMHSDigital/Spackle#188 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/Spackle
Issue tương tự
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedĐang mởbug effort:s impact:med raised-by:worker risk:low to:worker
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
medici-finance/assay#8120 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
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 77/100
agent-substrate/substrate#4308 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
celestiaorg/celestia-app#8877 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sweep
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
bketelsen/truenas-mcp#112 ·
Maintainer thường phản hồi trong vòng 1 ngày