Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Workspace index scan timeout of 15s is hardcoded and fails the whole Files panel with no partial result #10917

ClosedJoergHansmann(GitHub profile, opens in a new tab) opened this issue 1 comment

What happened

On a large workspace the Files panel is permanently unusable. Every attempt shows:

Failed to list workspace entries in 'D:\Workspace'.

The surfaced message does not name the cause. The real cause is only visible in ~/.t3/userdata/logs/server.trace.ndjson, nested inside exit.cause:

ProjectListEntriesError: Failed to list workspace entries in 'D:\Workspace'.
  [cause]: WorkspaceSearchIndexScanTimedOut: Workspace search index for
           'D:\Workspace' did not finish scanning within 15 seconds

Why this is a hard wall rather than a slow path

WORKSPACE_INDEX_SCAN_TIMEOUT_MS is 15000 and is compiled in. There is no setting in Settings, in settings.json or in client-settings.json that changes it. When the scan exceeds it, waitForIndexReady fails and the whole projects.listEntries call fails. No partial listing is returned, so the panel shows nothing at all.

WORKSPACE_INDEX_IDLE_TTL is 15 minutes, so the index is dropped while idle and the failure repeats on every later use. There is no state in which the panel recovers.

A fixed wall-clock budget for an operation whose cost varies tenfold

Two durations of WorkspaceSearchIndex.waitForIndexReady from the rotated trace logs, same machine, same workspace, nothing changed in between on my side:

DateDurationOutcome
2026-09-0810232 msscan completed, panel worked
2026-09-0915028 msdeadline hit, panel dead

I cannot tell you why the second one was slower, and that is the point. To find out, I timed an equivalent directory walk over the same tree in two cache states:

WalkFilesDuration
Cold OS metadata cache146377100.8 s
Warm OS metadata cache1463779.9 s
Warm, with build and VCS directories excluded934823.2 s

The operating system's directory-metadata cache is worth about a factor of ten here. Cutting the tree by 36 % is worth about a factor of three. So a fixed 15-second budget is being applied to work whose real cost swings by an order of magnitude for reasons that have nothing to do with the workspace: a reboot, memory pressure, another process evicting the cache, a slower disk.

That makes the failure intermittent rather than deterministic, which is far harder to diagnose than a clean size limit. It also means every large workspace is at its most fragile right after a reboot, exactly when a user is most likely to open the app.

For scale, the tree the indexer actually walks:

LevelFiles
Total in tree655098
Under node_modules (already excluded by T3)478681
Effectively scanned146377

I deliberately quote no files-per-second figure for T3 itself. The 15028 ms scan never finished, so its rate is unknown, and the cache measurements above show that any such figure is meaningless without stating the cache state it was taken in.

Environment

  • T3 Code 0.0.40 (Alpha), installed via winget install T3Tools.T3Code
  • Windows 10 Home 19045, workspace on a local NTFS drive
  • Workspace is not a git repository; it is a Subversion working copy
  • Reinstalling does not help, since nothing about the install is at fault

Suggested fixes, in order of preference

  1. Return whatever the scan has found when the deadline passes, and mark the listing as incomplete, instead of failing the entire call. A truncated file tree is far more useful than an error string.
  2. Make the timeout configurable per project or globally.
  3. Keep a successful index across the idle TTL for workspaces whose scan is known to be slow, so the cost is paid once rather than every 15 minutes.

Related to #4640, which reports the sibling problem of silent truncation at 25,000 entries. Both come down to the same thing: large workspaces have no supported path.

  1. Triage

    Confirmed on current main. This is a real bug, not a client glitch and not a wash of #4640.

    What the code does

    projects.listEntries builds a per-workspace FileFinder and blocks construction on waitForIndexReady(15000):

    • WORKSPACE_INDEX_SCAN_TIMEOUT_MS = 15_000 in apps/server/src/workspace/WorkspaceSearchIndex.ts — compiled in. Nothing in Settings, settings.json, or env changes it.
    • If the native wait returns “not ready”, make() throws WorkspaceSearchIndexScanTimedOut and acquireRelease destroys the finder. list() never runs. No partial entries, no truncated: true.
    • WorkspaceEntries.list does not catch that error. The RPC becomes ProjectListEntriesError with the generic message Failed to list workspace entries in '…'. The structured failure: "search_index_scan_timed_out" / timeout fields are on the wire; the Files panel only shows .message, which matches the report.
    • After 15 minutes idle, WorkspaceSearchIndexMap (idleTimeToLive: "15 minutes") drops the index. The next open reconstructs from scratch and can miss the same 15s wall again.

    Web Files, desktop (wraps web), and mobile Files all use this RPC. File picker, composer path search, and content search go through the same make() wait, so they fail with the panel.

    Content grep in the same module already fail-opens on a 250ms budget and returns truncated. The path-index scan does not.

    refresh logs + invalidates on ScanTimedOut. First construction does not recover.

    ItemRelation
    #4640Sibling. Same file, WORKSPACE_INDEX_MAX_ENTRIES = 25_000: scan succeeds, tree is silently cut. This issue is scan fails, tree is empty. Same “large workspace has no supported path” theme; different bug.
    #10918Distinct companion. No documented / settings way to exclude dirs; .gitignore is git-only. This workspace is a Subversion WC. Exclusion can shrink the walk; it does not change the fail-closed timeout.
    #8402Open, not merged. Fallback is only WorkspaceSearchIndexCreateFailed (native binding missing). PR states scan timeouts are not masked. Even merged, this path would still fail closed.

    No merged PR changes the 15s constant or the fail-closed list path. The 15s budget was wired in #4855.

    The 10.2s success vs 15.0s timeout on the same tree is consistent with a fixed wall-clock budget on a walk whose cost is dominated by OS directory-metadata cache (reporter: ~100s cold vs ~10s warm over ~146k files after node_modules exclusion).

    Suggested direction

    1. On deadline, keep the finder and return whatever it has with truncated: true (breadcrumbs already have “partial workspace index” copy). A truncated tree is usable; an error string is not.
    2. Optionally expose the timeout (global or per project).
    3. Optionally keep a successful index past the 15m idle TTL when the last scan was near the deadline, so a warm/slow workspace is not evicted into another coin-flip.

    #4640 and #10918 should stay open as their own issues.

    Surfaces

    • Entry points: Files panel, file picker, composer @ search, content search.
    • Clients: web, desktop, mobile — shared listEntries / index make().
    • Providers: n/a.
    • Contracts: search_index_scan_timed_out already exists; fail-open would reuse ProjectListEntriesResult.truncated.
    • Connection modes: server-side; local / remote / tunnel all hit it.
  2. juliusmarminge added labelsbug

  3. juliusmarminge added labelsaccepted

  4. juliusmarminge added labelsvia-triage

Sign in to join this conversation.