Smart Token Budgeting & Large Diff Truncation for Large Commits
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
- 45/100
Hướng nghiên cứu
Start by reading the staged-diff handling in internal/git and the configuration surfaces config.env and .git-commit-summary.yaml. Use mock large diff inputs to understand the required internal/git tests. Done means oversized diffs stay within configured limits, lockfiles and generated files are collapsed, and the related configuration or CLI option is covered by tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem Statement
When working on large commits (such as updating dependency lockfiles (go.sum, package-lock.json), large code refactors, or bulk file additions), the raw git diff can easily exceed LLM context windows or unnecessarily consume a large number of input tokens. Currently, git-commit-summary sends the entire raw diff to the LLM provider.
Proposed Feature: Smart Token Budgeting & Large Diff Truncation
Implement a preprocessing step for staged diffs that ensures large changes fit comfortably within LLM token limits while retaining the essential semantic summary of the changes.
Detailed Outline Plan
-
Diff Statistics & Token Estimation:
- Parse the git diff output into file-level chunks (
internal/git). - Implement a lightweight token estimator (e.g., character-to-token heuristic or using a tokenizer helper) to gauge the size of each file diff.
- Parse the git diff output into file-level chunks (
-
Diff Prioritization & Truncation Strategy:
- Lockfiles & Generated Files: Automatically collapse or omit full diffs for well-known generated files / lockfiles (
go.sum,package-lock.json,pnpm-lock.yaml, minified assets), replacing them with a summary line (e.g.,... (lockfile updated: X dependencies added, Y removed)). - Code Files: If total diff exceeds a configured threshold (e.g., max token limit or max line count):
- Prioritize core logic files over documentation or tests, or truncate individual file diffs after a maximum number of hunks/lines, appending a truncation notice (e.g.,
... [diff truncated for length]).
- Prioritize core logic files over documentation or tests, or truncate individual file diffs after a maximum number of hunks/lines, appending a truncation notice (e.g.,
- Lockfiles & Generated Files: Automatically collapse or omit full diffs for well-known generated files / lockfiles (
-
Configuration & Flags:
- Add configuration options (in
config.env/.git-commit-summary.yaml) for max diff tokens / size thresholds. - Add CLI flag support if needed (e.g.,
--max-diff-tokens).
- Add configuration options (in
-
Testing & Validation:
- Add unit tests in
internal/gitfor diff truncation and lockfile collapsing logic. - Verify behavior against mock large diff inputs.
- Add unit tests in
- Ngôn ngữ chính
- Go
- Star
- 0
- Fork
- 0
- Merge trung bình
- 7 giờ 59 phút
- Pull request đã merge (30 ngày)
- 9
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 rm-hull/git-commit-summary
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
rm-hull/git-commit-summary#190 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
rm-hull/git-commit-summary#189 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
rm-hull/git-commit-summary#185 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
rm-hull/git-commit-summary#184 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
rm-hull/git-commit-summary#106 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rm-hull/git-commit-summary
Issue tương tự
-
refine bluetooth scan listĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
AvengeMedia/DankMaterialShell#3761 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: clarify replacement for outdated Terms of Service URL in readme.mdCó thể đã có người làm @mohitjoshi-hey đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SocialGouv/iterion#2320 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
helm chart: the first upgrade after install restarts the filer and S3 gateway although nothing changedCó thể đã có người làm @egezamb đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[mesheryctl] Potential runtime panic (index out of range) in system status when pod container statuses are partially populatedCó thể đã có người làm @Ayush-AM đã nhận hôm nay. Đang mởcomponent/mesheryctl kind/bug language/go
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
meshery/meshery#22312 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày