Skip to content

fix(client): raise project-open and directory-suggestion timeouts for large repos#1620

Open
jms830 wants to merge 1 commit into
getpaseo:mainfrom
jms830:fix/large-repo-timeouts
Open

fix(client): raise project-open and directory-suggestion timeouts for large repos#1620
jms830 wants to merge 1 commit into
getpaseo:mainfrom
jms830:fix/large-repo-timeouts

Conversation

@jms830

@jms830 jms830 commented Jun 19, 2026

Copy link
Copy Markdown

Raise project-open and directory-suggestion timeouts for large repos

When opening massive repositories or resolving directory suggestions in large user home directories, the daemon's directory scans can take longer than the client's default 10-second request timeout. This leads to silent client-side timeouts and broken UX in the folder-picker autocomplete.

This PR raises:

  • openProject timeout from 10s to 30s.
  • getDirectorySuggestions timeout from 10s to 60s.

Ensures client doesn't prematurely drop in-flight scans on slower disk setups or massive checkouts.

…arge repos

openProject 10s->60s and getDirectorySuggestions 10s->30s + debounce the
project-picker query 250ms. On large local repos the daemon's path-resolve and
home-tree scan take several seconds; firing per-keystroke against a 10s timeout
raced the suggestion list to empty (e.g. ~/gi found a hit but ~/gith blanked)
and surfaced a spurious 'Timeout waiting for message (10000ms)' on add.
@greptile-apps

greptile-apps Bot commented Jun 19, 2026

Copy link
Copy Markdown

Greptile Summary

This PR addresses silent client-side timeouts when opening large repositories or scanning large home directories for folder-picker autocomplete. It raises the openProject timeout to 60 s and getDirectorySuggestions to 30 s, and adds a 250 ms debounce on the directory-suggestions query key so filesystem scans are not triggered on every keystroke.

  • daemon-client.ts: openProject timeout raised 10 s → 60 s; getDirectorySuggestions timeout raised 10 s → 30 s, with explanatory inline comments for each.
  • project-picker-modal.tsx: Introduces debouncedQuery state with a 250 ms useEffect debounce; the queryKey and RPC call now use debouncedQuery while the visible filter (options) still reacts to the immediate query.

Confidence Score: 4/5

Safe to merge; the timeout values are internally consistent and the debounce logic is correct. The PR description has the two timeout numbers swapped relative to what the code actually sets, which could confuse future readers of the commit history.

Both changed files make narrow, targeted edits with no side effects. The debounce is wired correctly — reset on modal close, immediate query still drives the display filter, only the RPC call defers. The one notable issue is that the PR description lists the timeout values in the wrong order compared to the implementation, but the code and inline comments agree with each other.

No files require special attention; the mismatch is documentation-level only.

Important Files Changed

Filename Overview
packages/client/src/daemon-client.ts Raises openProject timeout from 10s → 60s and getDirectorySuggestions timeout from 10s → 30s; values are internally consistent with the inline comments but reversed compared to the PR description.
packages/app/src/components/project-picker-modal.tsx Adds a 250 ms debounce via a new debouncedQuery state so the directory-suggestions RPC fires at most once per pause, not on every keystroke; reset path correctly clears both query and debouncedQuery.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant UI as ProjectPickerModal
    participant DQ as debouncedQuery (250ms)
    participant RQ as React Query
    participant DC as DaemonClient
    participant D as Daemon

    User->>UI: types keystroke
    UI->>DQ: setQuery(text)
    Note over DQ: debounce timer resets
    DQ-->>RQ: setDebouncedQuery after 250ms
    RQ->>DC: getDirectorySuggestions(debouncedQuery)
    Note over DC: timeout = 30 000 ms
    DC->>D: directory_suggestions_request
    D-->>DC: directory_suggestions_response
    DC-->>RQ: entries[]
    RQ-->>UI: directorySuggestionsQuery.data

    User->>UI: selects path
    UI->>DC: openProject(path)
    Note over DC: timeout = 60 000 ms
    DC->>D: open_project_request
    D-->>DC: open_project_response
    DC-->>UI: OpenProjectPayload
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant UI as ProjectPickerModal
    participant DQ as debouncedQuery (250ms)
    participant RQ as React Query
    participant DC as DaemonClient
    participant D as Daemon

    User->>UI: types keystroke
    UI->>DQ: setQuery(text)
    Note over DQ: debounce timer resets
    DQ-->>RQ: setDebouncedQuery after 250ms
    RQ->>DC: getDirectorySuggestions(debouncedQuery)
    Note over DC: timeout = 30 000 ms
    DC->>D: directory_suggestions_request
    D-->>DC: directory_suggestions_response
    DC-->>RQ: entries[]
    RQ-->>UI: directorySuggestionsQuery.data

    User->>UI: selects path
    UI->>DC: openProject(path)
    Note over DC: timeout = 60 000 ms
    DC->>D: open_project_request
    D-->>DC: open_project_response
    DC-->>UI: OpenProjectPayload
Loading

Reviews (1): Last reviewed commit: "fix(client): raise project-open & direct..." | Re-trigger Greptile

timeout: 10000,
// Large local repos (e.g. a big monorepo/brain checkout) need >10s for the
// daemon to resolve the path, detect git, and materialize the workspace.
timeout: 60000,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 PR description has the timeout values swapped

The PR description states "openProject timeout from 10s to 30s" and "getDirectorySuggestions timeout from 10s to 60s", but the implementation does the opposite: openProject is raised to 60 000 ms and getDirectorySuggestions to 30 000 ms. The inline code comments and the logic both support the as-implemented values (opening a project does more work), so the code appears correct, but the PR description is misleading for anyone reviewing the change or reading git history.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant