Skip to content

specs(GH10207): file tree degraded-mode handling#10490

Open
SagarSDagdu wants to merge 2 commits intowarpdotdev:masterfrom
SagarSDagdu:sagar/specs-gh-10207
Open

specs(GH10207): file tree degraded-mode handling#10490
SagarSDagdu wants to merge 2 commits intowarpdotdev:masterfrom
SagarSDagdu:sagar/specs-gh-10207

Conversation

@SagarSDagdu
Copy link
Copy Markdown
Contributor

@SagarSDagdu SagarSDagdu commented May 8, 2026

Description

Tech spec for issue #10207 (Project Explorer fails to expand populated folders in large repos after ExceededMaxFileLimit).

Splitting this out from PR #10234 (which carries a conservative reactive fallback already) so the design questions @moirahuang raised can be debated independently of the existing code review.

The spec evaluates three open questions:

  1. Pre-detect "too many files" or always lazy-load? — recommends keeping the reactive fallback as the load-bearing mechanism. Pre-detection only helps git repos cheaply (via git ls-files | wc -l) and the savings are bounded to a partial walk in a ctx.spawn background task. Worth revisiting later as an optimization once telemetry tells us whether it matters.
  2. Should we show a toast? — recommends replacing the transient toast with a persistent dismissible inline indicator on the affected root header, carried via an indexed_with_limit flag on FileTreeState (mirrors the existing "Codebase too large" pattern in AI settings). The transient toast was easy to miss during manual testing.
  3. Performance of lazy load — keep the existing 5k cap; instrument lazy-load latency before tuning; consider moving lazy-load off the main thread as a follow-up.

Also flags the parallel ExceededMaxFileLimit consumers in ai::project_context::model, ai::outline::native, and ai::index::full_source_code_embedding that this PR (and #10234) do not change.

Linked Issue

#10207

  • The linked issue is labeled ready-to-spec or ready-to-implement.

Screenshots / Videos

N/A — spec-only change.

Testing

N/A — documentation. The validation plan for the implementation lives in the Testing and validation section of TECH.md.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Evaluates the three questions raised in PR review on warpdotdev#10234:
1. Pre-detect too-many-files vs reactive fallback — recommend keeping
   the reactive fallback as the load-bearing mechanism; consider a
   git-ls-files probe only as a later optimization once telemetry shows
   the partial walk matters.
2. Toast vs persistent indicator — recommend a per-root, dismissible
   inline indicator carried via an `indexed_with_limit` flag on
   `FileTreeState`, replacing the transient toast and the dedicated
   event variant. Survives view-mount-after-indexing (which is why the
   toast was missed during manual testing).
3. Lazy-load performance — keep the existing 5k cap; instrument before
   tuning; consider moving lazy-load off the main thread as a follow-up.

Also flags the parallel ExceededMaxFileLimit consumers in
ai::project_context, ai::outline, and ai::index that this PR does not
change.
@cla-bot cla-bot Bot added the cla-signed label May 8, 2026
@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 8, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@SagarSDagdu

I'm starting a first review of this spec-only pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This TECH.md proposes a degraded file-tree mode for repositories that exceed MAX_FILES_PER_REPO, replacing a transient toast with persistent inline state and documenting lazy-load performance follow-ups.

Concerns

  • The degraded retry is specified as a depth-1 build_tree retry, but the spec does not define behavior for repos with more than the file quota directly under the root, so the fallback can still fail and reproduce the empty-tree state.
  • The telemetry follow-up still refers to RepositoryIndexedWithLimit after the spec recommends deleting that event, leaving the instrumentation source ambiguous.
  • One testing path names a non-existent test file, which can misdirect implementation.

Verdict

Found: 0 critical, 1 important, 2 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

Comment thread specs/gh-10207/TECH.md Outdated
Comment thread specs/gh-10207/TECH.md Outdated
Comment thread specs/gh-10207/TECH.md
- Q1: call out that the current PR's depth-1 retry still uses a 100k
  file quota, so a repo with >100k files directly at the root would hit
  ExceededMaxFileLimit on the retry and reproduce the original empty-tree
  bug. Spec now requires the depth-1 retry to pass `None` for the file
  quota; bounded cost is the count of root-level entries (subdirectories
  are unloaded immediately at depth=1).
- Add a unit-test entry covering the >100k-files-at-root regression so
  the gap is validated.
- Drop the `RepositoryIndexedWithLimit` event name from the telemetry
  follow-up since Q2 recommends dropping that event entirely; reference
  the persistent `indexed_with_limit` state transition and the existing
  `BuildTreeFailed` telemetry at local_model.rs:1001 instead.
@SagarSDagdu
Copy link
Copy Markdown
Contributor Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@SagarSDagdu

I'm re-reviewing this spec-only 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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This tech spec covers the file-tree degraded-mode fallback for repositories exceeding MAX_FILES_PER_REPO, including the reactive indexing strategy, user-facing degraded indicator, lazy-load performance posture, validation plan, and follow-up work.

Concerns

  • The degraded-mode filesystem skill probe needs an explicit symlink/root-containment requirement and validation so it preserves the trust boundary of the existing tree builder.
  • The FileTreeState compatibility guidance omits from_file_tree_entry, so an implementation following the spec would either fail to compile or leave remote/file-tree constructed state underspecified.

Security

  • The filesystem fallback for repo-local skills must reject symlinked or repo-escaping skill directories, not just gitignored paths.

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

Comment thread specs/gh-10207/TECH.md
on the depth-1 retry the test asserts `IndexedRepoState::Indexed` with
`indexed_with_limit == true` and the root entry containing all top-level
files.
- Unit: `find_top_level_skill_directories_in_filesystem` honors gitignore.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] [SECURITY] The filesystem probe validation only covers gitignore; add requirements/tests that reject symlinked provider or skills directories and any path escaping the repo so degraded-mode probing preserves the existing Entry::build_tree trust boundary.

Comment thread specs/gh-10207/TECH.md
- **Carrying `indexed_with_limit` on `FileTreeState`** is observable from
many crates that pattern-match the struct. We avoid breakage by adding a
`bool` field with a `Default` value of `false` and updating the two
constructors (`new`, `new_lazy_loaded`); existing call sites compile
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] FileTreeState also has from_file_tree_entry; specify how indexed_with_limit is initialized there (probably false unless remote metadata can carry the flag), otherwise following this spec leaves one constructor broken or ambiguous.

Comment thread specs/gh-10207/TECH.md
when registering a root via `register_and_refresh_lazy_loaded_directory`
(`view.rs:1532-1589`).

If the team prefers no UI signal at all, drop the indicator entirely and
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my proposal here is no toast, in the context of the file tree there's no significant degradation of experience. if the user searches for rules / results and things are missing, that's outside of the scope of the file tree

Comment thread specs/gh-10207/TECH.md
independently and hit the same hard limit. They are tracked separately and
this spec does not change their behavior.

## Proposed changes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to this comment let's be explicit about the symlinked case and expected behavior there

@moirahuang
Copy link
Copy Markdown
Contributor

@SagarSDagdu I just chatted with @alokedesai, we're going to talk more on Monday about if we want to just lazy load in general for the file tree instead of eagerly loading and then lazy loading only if the codebase size is too big. I'll come back here with a decision after that discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants