You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rtk git diff/show --max-lines may inflate savings same way as #1045 #1561
#1045 was about rtk read counting user-requested line truncation as RTK token savings. The same pattern likely exists in:
src/cmds/git/git.rs:200 — git diff tracking
src/cmds/git/git.rs:314 — git show tracking
Both currently track against the compacted output. compact_diff itself is real RTK compression so that part is legitimate — but when a user passes --max-lines N to rtk git diff / rtk git show, the truncated portion gets counted as savings same as the original bug.
Reproduce (likely)
rtk git diff --max-lines 5 # large diff
rtk gain --history # check if the saved-tokens row for this command is suspiciously high
Re-read the prior attempt at #1573 — the close reason wasn't a technical rejection, it was procedural: the CLA bot flagged :x: github-actions[bot] as an unsigned committer (likely because the branch had a release-please auto-commit pulled in along with manual Cargo.toml / CHANGELOG.md / release-please-manifest.json edits), and after 9 days with no human review SAY-5 closed citing "triage feedback" — but the only triage was @pszymkowiak's wshm bot summary which actually said low risk + tests present. So the approach was sound, just blocked on plumbing.
Plan for this attempt:
Branch off upstream/develop HEAD, no Cargo.toml / CHANGELOG.md / release-please-manifest.json edits (release-please owns those).
Surgical changes in src/cmds/git/git.rs only.
Keep the design from @pszymkowiak's suggested fix: factor RTK's compression budget (the 500-line compact_diff default — legitimate savings) away from user-supplied --max-lines truncation (not savings), track against the pre-truncation slice via timer.track(... &content_before_user_truncation, ...).
Unit tests pinning both rows: rtk-side compression still counts, user --max-lines does not.
Out of scope (per the issue itself): polluted historical data in the local DB.
Closing: rtk git diff and rtk git show have no --max-lines option, so there is no user-requested truncation to count as savings. rtk git diff --max-lines 5 passes the flag to git, which rejects it with unknown option 'max-lines'.
Activity
pszymkowiak commentedon Apr 27, 2026
🔍 Automated Triage
buglowSummary
rtk git diff/show --max-lines incorrectly counts user-requested truncation as RTK token savings; fix in progress via PR #2107
📁 Relevant files
src/cmds/git/git.rssrc/cmds/system/read.rssrc/core/utils.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
maxmilian commentedon May 26, 2026
Picking this up.
Re-read the prior attempt at #1573 — the close reason wasn't a technical rejection, it was procedural: the CLA bot flagged
:x: github-actions[bot]as an unsigned committer (likely because the branch had a release-please auto-commit pulled in along with manualCargo.toml/CHANGELOG.md/release-please-manifest.jsonedits), and after 9 days with no human review SAY-5 closed citing "triage feedback" — but the only triage was @pszymkowiak'swshmbot summary which actually saidlow risk+tests present. So the approach was sound, just blocked on plumbing.Plan for this attempt:
upstream/developHEAD, noCargo.toml/CHANGELOG.md/release-please-manifest.jsonedits (release-please owns those).src/cmds/git/git.rsonly.compact_diffdefault — legitimate savings) away from user-supplied--max-linestruncation (not savings), track against the pre-truncation slice viatimer.track(... &content_before_user_truncation, ...).Draft PR incoming.
fix(git): don't count --max-lines truncation as savings (rtk-ai#1561)
fix(git): don't count --max-lines truncation as savings (rtk-ai#1561)
Yohjisakamoto commentedon Jul 22, 2026
This inflated git savings case reinforces why end-to-end agent outcomes matter more than compressed text alone: DeepSWE found Tura cuts coding-agent rounds by 89% and total token cost by 80%; would you evaluate the methodology? https://turaai.net/docs#benchmark-current-test-set-record
KuSh commentedon Oct 31, 2026
Closing:
rtk git diffandrtk git showhave no--max-linesoption, so there is no user-requested truncation to count as savings.rtk git diff --max-lines 5passes the flag to git, which rejects it withunknown option 'max-lines'.