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
Honor agent re-includes in ripgrep project listings - #1759
The new ripgrep project listing is meant to preserve the directory walker's ignore decisions. With .codebuffignore containing !node_modules and !node_modules/**, the walker finds node_modules/pkg/index.ts, but the ripgrep path omits it without marking the result incomplete. glob uses this listing on the local disk.
The retry for agent-owned negations turns off Git ignore pruning but still passes the generated default-directory ignore file. Those defaults exclude the directory before the final ignore chain can apply the explicit re-include.
Changes
Give the ordinary listing its existing default-directory pruning arguments, and omit that file from the existing unpruned retry. The final project ignore filter still decides which candidates are returned.
Add one real-directory regression using the bundled ripgrep and the actual walker. It requires the re-included dependency file to be discovered while a Git-ignored file and an agent-blocked file remain absent.
Verification
Windows x64, Bun 1.3.14, base 88be5fff67efbc76489943d5e1295405b3d9cfe7; isolated test home, --no-env-file, and the repository's placeholder-only sdk/test/setup-env.ts preload.
New regression: before 0 pass, 1 fail (missing node_modules/pkg/index.ts); after 1 pass, 0 fail.
bun test sdk/src/__tests__/list-project-files.test.ts -t 're-includes|honors|keeps': 5 pass, 0 fail.
bun test sdk/src/__tests__/glob.test.ts -t 'on the local disk': 3 pass, 0 fail, including discovery beyond the walk's cap and result-limit behavior.
Full two-file run: 7 pass, 3 skip, 7 fail on main with the new regression; 8 pass, 3 skip, 6 fail after the fix. The same six existing Windows failures remain: five POSIX-path mock fixtures and one symlink-creation EPERM. The three platform skips are existing POSIX process tests. This is not a passing whole-suite claim.
SDK tsc --noEmit -p sdk, frozen-lockfile install, SDK build, Windows Freebuff binary build, binary version and smoke: passed.
Prettier and git diff --check: passed. ESLint: 0 errors, 4 warnings, identical to main's resolver warnings.
Notes / Scope
This is a source-audit finding without an existing issue being claimed. An agent-owned negation can now make the existing retry enumerate built-in excluded directories as candidates; the final filter still applies defaults and project rules. This favors correct re-inclusion over pruning that cannot be undone. The existing 500,000-file and 20-second scan bounds and incomplete-result notice remain in place. Ordinary listings retain their pruning, and cancellation, filesystem injection and public APIs are unchanged.
No Linux/macOS or full-monorepo run was performed. The regression uses no model service, account or module mock.
Good catch and a clean fix. In listCandidates, args previously always included --ignore-file <defaultsFile>, so when unpruned = [...args, '--no-ignore-vcs'] was built for the agent re-include retry, it still carried the default directory-pruning ignore file — defeating the purpose of the retry for cases like !node_modules / !node_modules/**. Splitting args into a base (no defaultsFile) and a separate pruned variant (base + defaultsFile) for the normal path, while leaving unpruned built from the defaultsFile-free base, is the right fix and keeps the normal listing's behavior unchanged.
The added regression test in list-project-files.test.ts is well targeted — it exercises exactly the reported scenario (re-included node_modules/pkg/index.ts alongside a blocked file and a git-ignored file) and compares against the real walker via walkEverything, which is the right oracle here given ripgrep is meant to mirror walker decisions.
The PR body's verification section is unusually exhaustive for a two-file diff, but the substance checks out: the before/after test counts match the claimed bug, and the comment updates in the docstring/code accurately describe the new behavior (mentioning both Git and built-in directory pruning being lifted in the retry, with the final ignore chain still deciding what's returned).
No concerns about scope — this only touches sdk/. Worth porting as-is; the only minor suggestion is to double check behavior on Linux/macOS since this PR's verification was Windows-only, given path-handling differences noted in the body itself.
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
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.
Problem / Why
The new ripgrep project listing is meant to preserve the directory walker's ignore decisions. With
.codebuffignorecontaining!node_modulesand!node_modules/**, the walker findsnode_modules/pkg/index.ts, but the ripgrep path omits it without marking the result incomplete.globuses this listing on the local disk.The retry for agent-owned negations turns off Git ignore pruning but still passes the generated default-directory ignore file. Those defaults exclude the directory before the final ignore chain can apply the explicit re-include.
Changes
Verification
Windows x64, Bun 1.3.14, base
88be5fff67efbc76489943d5e1295405b3d9cfe7; isolated test home,--no-env-file, and the repository's placeholder-onlysdk/test/setup-env.tspreload.node_modules/pkg/index.ts); after 1 pass, 0 fail.bun test sdk/src/__tests__/list-project-files.test.ts -t 're-includes|honors|keeps': 5 pass, 0 fail.bun test sdk/src/__tests__/glob.test.ts -t 'on the local disk': 3 pass, 0 fail, including discovery beyond the walk's cap and result-limit behavior.tsc --noEmit -p sdk, frozen-lockfile install, SDK build, Windows Freebuff binary build, binary version and smoke: passed.git diff --check: passed. ESLint: 0 errors, 4 warnings, identical to main's resolver warnings.Notes / Scope
This is a source-audit finding without an existing issue being claimed. An agent-owned negation can now make the existing retry enumerate built-in excluded directories as candidates; the final filter still applies defaults and project rules. This favors correct re-inclusion over pruning that cannot be undone. The existing 500,000-file and 20-second scan bounds and incomplete-result notice remain in place. Ordinary listings retain their pruning, and cancellation, filesystem injection and public APIs are unchanged.
No Linux/macOS or full-monorepo run was performed. The regression uses no model service, account or module mock.