Skip to content

Path search on a large workspace stalls the host daemon past its lease, server drops the local host #5385

Closed

Description

@viktor-nikolaev

bb version: 0.46.0 (desktop, macOS 27.0.1, arm64), single local machine (server + host daemon on the same box)

What happens

On a project whose root contains a large untracked-but-not-ignored subtree, opening the file picker / @-mention path search makes the UI show "host disconnected" for my own local machine. While it lasts, everything that needs the host fails with host_unavailable (/api/v1/files/read, /files/write, /environments/<id>/status, /pull-request, provider discovery).

Repro

  1. Create a project whose root has a few hundred thousand+ files that git does not ignore (in my case ~1.4M entries under one subfolder holding nested git clones).
  2. In a thread of that project, open the file picker / type @ and a few characters.
  3. Within ~30 s the host is reported disconnected; it reconnects a second later.

Evidence from logs

~/.bb/logs/server.1.log, same sequence three times in one evening:

21:29:30–21:29:58  GET /api/v1/projects/<id>/paths   -> 504 "Timed out waiting for command result" (x27)
21:29:58           "Daemon sent nothing within its lease; closing its socket"
21:40:01–21:40:16  GET /api/v1/projects/<id>/paths   -> 504 (x18)
21:40:34           "Daemon sent nothing within its lease; closing its socket"
21:48:47–21:48:58  GET /api/v1/environments/<id>/paths -> 504 (x17)
21:49:14           "Daemon sent nothing within its lease; closing its socket"

host-daemon.1.log shows matching Disconnected from server (code 1006) followed by Connected to server ~1 s later.

Why (from reading the shipped bundle)

  • host.list_paths / host.list_files -> listWorkspacePaths -> listPathsRecursively walks the entire tree on every request. There is no entry cap, no time budget, and no cache beyond de-duplicating concurrent identical listings.
  • The only exclusions are git ignore rules and the hard-coded DEFAULT_PATH_LIST_EXCLUDE_NAMES (node_modules, .venv, .next, ...). There is no per-project way to add more.
  • The whole result is materialised and fuzzy-ranked in one go. With ~1.4M entries this keeps the daemon from sending anything for longer than LEASE_TIMEOUT_MS = 30000, so handleDaemonSessionSilent closes the session.

Making the folder git-ignored is not an option for me: other tools I rely on stop loading nested repo config under ignored paths.

Suggestions (any one would fix it)

  1. Cap the walk (entry count and/or time budget) and return truncated: true, like the result limit already does.
  2. Let a project configure extra excluded paths (or honour a .ignore / .bbignore file, the way ripgrep honours .ignore).
  3. Keep heartbeats flowing during long host commands (yield / run the walk off the main loop) so a slow listing cannot expire the lease.
  4. Cache the listing per root and refresh it incrementally (the daemon already ships a parcel watcher).

Unrelated, same session: the connect plugin reloaded three times within 20 s at 21:52 and threw PluginContextStaleError: plugin "connect" used a stale API handle from ConnectTunnel.resolveStreamOrigin (4 uncaught exceptions).

Activity

  1. added theissue type on Oct 12, 2026
  2. added
    host
    partial-repro
    on Oct 12, 2026
  3. bb-slop-cop commented on Oct 12, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · High priority · Medium effort; labels host, perf, partial-repro.
    • Reproduction and root-cause report: PARTIALLY REPRODUCED, root-cause confidence high.
    • Root cause: concurrent commands share discovery, but each synchronously fuzzy-ranks the entire listing. Two clean trusted-main checkouts measured 54.3 s and 56.3 s timer gaps during 48 searches over 150,000 real files, despite a 20-result limit—longer than the 30-second lease.
    • Limits: timer starvation is reproduced at the actual host command handler; the macOS desktop/WebSocket disconnect and unrelated plugin errors remain unverified. Reproduction label: partial-repro.
    • No PR: the full end-to-end disconnect remains unverified, and no ranking-preserving repair qualifies for the rule's one-subsystem, decision-free simple-fix gate.

    AGENT GENERATED

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    hostpartial-reproperf

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions