perf(sdk): Omit ignored files from hunk prompts - #495
Open
alectimison-maker wants to merge 1 commit into
Open
Conversation
Keep analyzed and budget-limited paths in changed-file context while removing paths already classified as irrelevant. This reduces repeated prompt input without hiding incomplete scan coverage. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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
limit:*skipped file so budget/read coverage remains visible to the reviewer.Motivation
prepareFiles()already excludes built-in, user-ignored, generated, empty, and pattern-skipped files from analysis. Both execution paths then rebuilt prompt context from the original pull-request file list, so up to 50 excluded paths could still be sent with every hunk for every skill.This follows the pre-analysis filtering pattern used by Qodo PR-Agent, while retaining budget-limited filenames in the same spirit as its remaining-files context.
In a deterministic synthetic fixture with 40 long generated paths and 10 budget-limited relevant paths, one hunk user prompt decreased from 3,695 to 985 characters. This is prompt-size evidence, not a wall-clock or billed-token claim.
Design
selectChangedFilesForPrompt()omits only explicit irrelevant reasons:patternbuiltinignored:builtinignored:userignored:generatedAll
limit:*reasons, and any future reason not explicitly classified as irrelevant, fail open and remain in prompt context. Existing current-file exclusion andmaxContextFilesbehavior are unchanged.Testing
pnpm --filter @sentry/warden exec vitest run --config vitest.config.ts src/sdk/analyze.test.ts src/cli/output/tasks.test.ts src/sdk/prompt-sections.test.ts— passed, 98 testspnpm lint && pnpm build && pnpm test— passed, 1,915 tests passed and 4 repository-defined tests skippedpnpm typecheck— passed via the pre-commit hookupstream/main— no Standards or Spec findingsCompatibility and risks
There is no public configuration, schema, finding, or analysis-scope change. Ignored filenames can occasionally carry intent, so the selector deliberately keeps capacity/read/patch failures visible and removes only files Warden or the user already classified as irrelevant.
Scope
Incremental review, cross-run caching, prompt character budgets, and workflow cancellation remain separate work. Workflow cancellation is intentionally deferred while #402 tracks orphaned in-progress checks after runner cancellation.
Related to #378.