Fall back to lazy index when repo exceeds max file limit#10234
Fall back to lazy index when repo exceeds max file limit#10234SagarSDagdu wants to merge 6 commits intowarpdotdev:masterfrom
Conversation
When initial repo indexing exceeded MAX_FILES_PER_REPO (100k), the repo landed in IndexedRepoState::Failed and the file tree silently rendered an empty entry, hiding populated folders like .agents in monorepos (reported in warpdotdev#10207 with a 153k-file workspace). Now, on ExceededMaxFileLimit during the full-depth scan, fall back to a single-level scan so the user can still browse the tree — subdirectories load on expand via the existing 5k-per-directory lazy-load path. A new RepositoryIndexedWithLimit event surfaces a toast in the file tree view explaining the degraded mode. Closes warpdotdev#10207
…ded-max-file-limit-fallback
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR falls back to a shallow repository tree when full indexing exceeds the max-file limit and surfaces a degraded-mode toast to the file tree. The core fallback path updates the repository model, but one subscriber now explicitly drops the degraded-mode signal in a way that leaves repo-local skills undiscovered for the oversized repositories this change targets.
Concerns
- Project skill discovery scans on
RepositoryUpdated, but the fallback tree only contains first-level lazy directories. Provider directories such as.agents/skillsare not present until expansion, and the new degraded-mode event is ignored while later lazy-load updates only process queued creations. Oversized repos can therefore become browseable while their repo-local skills remain unloaded.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
In degraded mode the metadata tree is shallow (depth=1), so find_skill_directories_in_tree never sees provider paths like .agents/skills, leaving repo-local skills undiscovered. Add find_top_level_skill_directories_in_filesystem that probes the known skill provider paths directly under the repo root, and handle RepositoryIndexedWithLimit in SkillWatcher: watch the repo and feed the probed directories into spawn_read_skills_from_directories. The repository file watcher catches deeper/nested skill directories as they are added or as subtrees are lazy-loaded. Addresses review feedback on warpdotdev#10234.
|
/oz-review Fixed the previously mentioned issue, please re-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR retries oversized local repo indexing with a shallow tree, forwards a degraded-index event, and surfaces the degraded mode through file-tree/skill-watcher consumers.
Concerns
- The new file-tree toast handler discards the repository path, so a global repo metadata event can show the toast in file tree views or windows that are not displaying the large repo.
- This PR adds user-visible toast copy but does not include screenshots or video; for faster review, please upload visual evidence of the toast/behavior.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
RepoMetadataModel events are global and fire in every file-tree view, so unconditionally showing the toast popped it in unrelated windows. Only toast when the affected repo is one of this view's roots (either directly or as the backing entry of an absorbed root). Addresses review feedback on warpdotdev#10234.
|
/oz-review Fixed all the mentioned issues and resolved comments, please re-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR falls back to a shallow repo metadata index when the full scan exceeds the file limit, forwards a new degraded-index event, surfaces a file-tree toast, and adds filesystem probing for top-level skill provider directories.
Concerns
- The new filesystem skill probe is only wired into the async
RepositoryIndexedWithLimitevent path; the synchronousSkillWatcher::read_skills_for_repospath still reads only the shallow metadata tree, so cloud-environment initial skill loading can still miss repo skills in degraded mode. - This is user-visible behavior and copy, but the PR has no screenshot or video evidence. For faster review, please upload screenshots or a video of the feature working end to end.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
`SkillWatcher::read_skills_for_repos` is the synchronous entry point used by cloud-environment skill loading; it relied solely on `find_skill_directories_in_tree`, so degraded-indexed repos missed their skills there too. Also probe top-level skill provider paths via the filesystem and dedupe before reading. Addresses review feedback on warpdotdev#10234.
|
/oz-review Fixed all the mentioned issues and resolved comments, also attached a loom video for the demo. |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds a degraded indexing fallback for repositories that exceed the full-tree file limit, forwards a new metadata event, and surfaces a file-tree toast while preserving lazy directory expansion.
Concerns
- The new direct filesystem probe for top-level skill provider directories bypasses the metadata tree filtering path, so ignored
.agents/skillsor.claude/skillsdirectories can now be loaded as project skills.
Security
- Ignored repo-local skill provider directories can now be activated without the gitignore filtering used by the existing metadata-tree discovery path.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
The fallback probe accepted any `<repo>/<provider>/skills` directory that existed on disk, even if the repo's gitignore excluded it (e.g. a project that vendors a third-party `.claude/skills`). The tree-based path always honored gitignore via `get_repo_contents`'s `include_ignored=false` default, so degraded mode was strictly more permissive than full-depth mode. Load `gitignores_for_directory(repo_path)` and reject candidates that match (with `check_ancestors=true`, mirroring `Entry::build_tree`'s filter) before treating them as project skills. Addresses review feedback on warpdotdev#10234.
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
Oz no longer requests changes for this pull request after the latest automated review.
There was a problem hiding this comment.
Overview
This PR adds a degraded indexing fallback for repositories that exceed the full-tree file limit, forwards the new metadata event, shows a file-tree toast, and adds a direct root skill-directory probe for degraded repos.
Concerns
- Non-blocking: the toast visibility check can miss views rooted at deeper descendants of the oversized repo when those descendants are not present in the shallow fallback tree.
Verdict
Found: 0 critical, 0 important, 1 suggestions
Approve with nits
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| id: RepositoryIdentifier::Local(std_path), | ||
| } => { | ||
| // RepoMetadataModel is global; only toast in views that display this repo. | ||
| let displays_repo = self.root_directories.contains_key(std_path) |
There was a problem hiding this comment.
💡 [SUGGESTION] Include displayed descendant roots in this check; if the file tree is rooted inside a too-large repo but that path is not present in the shallow fallback tree, this currently skips the degraded-mode toast.
|
HI @SagarSDagdu, we really appreciate the initiative on the newly filed issue. Per the contribution guidelines, the Warp team will manually triage and add a |
Description
Fixes #10207. When initial repo indexing exceeded
MAX_FILES_PER_REPO(100k), the repo landed inIndexedRepoState::Failedand the file tree silently rendered an empty entry, hiding populated folders like.agentsin monorepos (the reporter has a 153k-file workspace).Loom for before and after
https://www.loom.com/share/660730d889b6466798b52210ca6f9049
What: On
ExceededMaxFileLimitduring the full-depth scan inLocalRepoMetadataModel, retry once withmax_depth=1and install the repo asIndexed. The existing per-directory lazy-load path (LAZY_LOAD_FILE_LIMIT=5000) handles expansion. A newRepositoryIndexedWithLimitevent surfaces a toast in the file tree view explaining the degraded mode.Why: The current behavior gives the user no way to browse a too-large repo and no signal that anything went wrong — the folder just looks empty.
How:
crates/repo_metadata/src/local_model.rs: in the build-tree spawn, retry withmax_depth=1onExceededMaxFileLimit. New event variantRepositoryIndexedWithLimit { path }. Telemetry still recordsBuildTreeFailed.crates/repo_metadata/src/wrapper_model.rs: forward the new variant.app/src/code/file_tree/view.rs: handle the new event with a toast — "Repository is too large to fully index. Subfolders load when expanded." Mirrors the existingshow_exceeded_file_limit_toastfor individual oversized subfolders.app/src/{search/files/model.rs, remote_server/server_model.rs, ai/skills/file_watchers/skill_watcher.rs}: add the new variant to existing no-op match arms.Linked Issue
Closes #10207
ready-to-specorready-to-implement.Screenshots / Videos
N/A — no UI layout changes; only a toast and behavior fix that is hard to demo without a 100k-file repo.
Testing
cargo test -p repo_metadata --lib— 46 passedcargo test -p warp --lib code::file_tree::— 41 passedcargo clippy -p repo_metadata -p warp --lib --tests -- -D warnings— cleancargo fmt --check— cleanRegression test gap: A direct unit test for the >100k fallback would require parameterizing
MAX_FILES_PER_REPO(currently aconst) so a test can use a small limit, or creating 100k+ files at test time (impractical). Happy to add a test-only override if reviewer prefers — left out to keep this fix minimal.Agent Mode