Repository navigation
Description
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
- 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).
- In a thread of that project, open the file picker / type
@and a few characters. - 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->listPathsRecursivelywalks 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, sohandleDaemonSessionSilentcloses 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)
- Cap the walk (entry count and/or time budget) and return
truncated: true, like the result limit already does. - Let a project configure extra excluded paths (or honour a
.ignore/.bbignorefile, the way ripgrep honours.ignore). - Keep heartbeats flowing during long host commands (yield / run the walk off the main loop) so a slow listing cannot expire the lease.
- 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
bb-slop-cop commentedon Oct 12, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilothost,perf,partial-repro.partial-repro.Keep path search on huge workspaces from dropping the host (get-bb#5507)