Repository navigation
fix(tier2): share a repeated text only when that shortens the review prompt - #346
Merged
Merged
Conversation
build_user_prompt shared every exactly repeated text once the request was over budget. A reference line costs 18 characters and a shared block adds a 23-character header, so a short body repeated under long headings got longer when shared. That could push a cluster that fits with the short bodies inline over the 64,000-character budget: 270 sections with long headings and the body "See guide." plus 14 sections sharing a 920-character body stopped with llm_prompt_size_limit. Each repeated text is now shared only when its block and references are shorter than its inline copies. The cost is measured with the same helpers that render the block and reference. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The review prompt docs, the defaults table and the CHANGELOG entry now say that repeated text is listed once only when that shortens the request. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995
marked this pull request as ready for review
November 5, 2026 21:40
rng1995
requested review from
chrisknvidia,
mosheabr and
rmalani-nv
as code owners
November 5, 2026 21:40
Collaborator
Author
|
Post-merge review: 3 finding(s) (P3). Follow-up PR: #361.
🤖 Generated with Claude Code |
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #338, which merged before its last review round. #338 lets Tier 2 send a large repeated-content cluster to the LLM by listing each exactly repeated text once and pointing to it from every member. It shares every repeated text once the request is over budget. A reference line costs 18 characters and a shared block adds a 23-character header, so a short body repeated under long headings gets longer when shared.
That can refuse a cluster that would fit with the short bodies inline. Example on
main: 270 sections with long headings and the bodySee guide., plus 14 sections sharing a 920-character body. The scan stops withllm_prompt_size_limit.build_user_promptnow shares a repeated text only when its block and its references are shorter than its inline copies. The cost is measured with the same helpers that render the block and the reference.docs/tier2-deduplication.mdx, its defaults table and the fix(tier2): review large repeated-content clusters within the prompt budget #338 CHANGELOG entry (Unreleased / Fixed) now say that repeated text is listed once only when that shortens the request.Why
#338's goal is to finish scans of skills with heavily repeated content instead of marking deduplication incomplete. Sharing that makes the request longer works against that goal, and it fails exactly on skills with many short, repeated sections.
Kept from public
Tests
tests/deduplication/intra_skill/test_intra_llm_analyzer.pyandtest_intra_skill_validator.py:tests/deduplication,tests/test_ci_workflows.pyandtests/test_accuracy_arithmetic.pyon currentmainplus this change: 365 passed, 1 skipped.ruff checkandruff format --checkare clean on the changed files, andscripts/check_oss_boundary.pypasses.🤖 Generated with Claude Code