Repository navigation
Include hidden entries in host file listings with server-owned exclusions - #3390
Merged
Merged
Conversation
The host daemon walker unconditionally skipped every dot-prefixed entry, so quick-open, @-mentions, and the Monaco file tree could not find files such as .github/workflows/ci.yml. Make hidden-entry inclusion a required field on host.list_files and host.list_paths, decided by the server: workspace search and the Monaco tree include hidden entries, while thread storage, skill enumeration, and the docs plugin keep them hidden. Expose includeHidden on the public files routes, SDK, and bb file CLI. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Including hidden entries lets dependency and cache directories such as .venv, .turbo, and .next dominate quick-open results and slow every keystroke. Move that exclusion policy to the server: host.list_files and host.list_paths take a required excludeNames list, the daemon only refuses .git on its own, and the server fills a default set (node_modules, .venv, venv, .turbo, .next, .cache, __pycache__, .DS_Store). The public files routes, SDK, and bb file CLI accept excludeNames to replace that set. Co-Authored-By: Claude Fable 5.1 <[email protected]>
host.list_files and host.list_paths gained required includeHidden and excludeNames fields, so enrolled daemons must update to accept them. Co-Authored-By: Claude Fable 5.1 <[email protected]>
ymichael
added a commit
that referenced
this pull request
Sep 10, 2026
## Human comments ## What was wrong After #3390 enabled hidden entries, every file-mention query recursively scanned ignored build output, dependency stores, and nested worktrees. Incremental typing started overlapping scans. A large checkout took 5.84 seconds to search roughly 304,000 entries, leaving the new-thread composer on “Searching mentions…”. ## What changed - Project and environment searches ask Git for ignored paths and prune those subtrees before traversal. Tracked files and non-ignored untracked files remain searchable, including hidden files. Empty directories, linked worktrees, and non-Git workspaces remain supported. - Concurrent queries share pending discovery but rank their results independently. Completed and failed listings are discarded, so subsequent queries see file and ignore-rule changes. Each fresh Git-backed discovery uses two Git subprocesses; there are no per-file subprocesses. - General filesystem APIs and skill/thread-storage listing retain their existing ignore behavior. The server explicitly supplies the new `respectGitIgnore` daemon field; protocol version increases from 198 to 199. - Keep `.pnpm-store` and root-relative `.claude/worktrees` in the default exclusions. Exclusions now support exact root-relative paths as well as basenames. Update CLI help and guide/SDK documentation. ## How you verified 226 relevant tests passed, including tracked files matched by ignore patterns, new untracked files, nested ignore rules and negation, linked worktrees, hidden files, shared discovery, failure recovery, and refresh after edits: ```sh pnpm exec turbo run test --filter=@bb/host-daemon -- file-list.test.ts workspace-path-list.test.ts pnpm exec turbo run test --filter=@bb/host-daemon -- workspace-dispatch.test.ts pnpm exec turbo run test --filter=@bb/server -- host-file-routes.test.ts public-environments.test.ts internal-environment-change.test.ts public-thread-data.test.ts pnpm exec turbo run test --filter=@bb/host-daemon-contract pnpm exec turbo run typecheck --filter=@bb/host-daemon --filter=@bb/server --filter=@bb/cli ``` With both new directory exclusions disabled, the same checkout improved from **5.84 s / 304,068 entries to 119 ms / 6,681 entries**, retaining README and hidden workflows. Verified in an isolated source app with Worktree selected: incremental `@README` search returned tracked and untracked files, selecting the untracked file inserted its mention, and an arbitrary Git-ignored build directory was omitted. The source CLI confirmed general filesystem listing can still inspect ignored files. No deployed instance was changed. > AGENT GENERATED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
This fixes #2093 without also regressing performance for the file search in projects with huge node_modules, etc. Basically right now hidden dirs are unconditionally skipped, this adds an option to the
list_filesandlist_pathscommands that allows to include hidden files.What was wrong
The host daemon's shared recursive walker (
listPathsRecursivelyinapps/host-daemon/src/command-handlers/file-list.ts) unconditionally skipped every dot-prefixed entry,node_modules, and symlinks. Bothhost.list_filesandhost.list_pathsgo through it and neither command carried a field to relax the rule, so quick-open,@-mentions, the Monaco file tree, and everyfiles.listPathsconsumer inherited it..github/workflows/ci.ymlcould be read throughhost.read_filebut never appeared in a listing. See #2093 and the investigation report.The dot rule was also accidentally doing gitignore's job: the report measured that simply removing it lets
.venv,.turbo, and.nextdominate results and slow each keystroke by 80 to 150x on Python and Next.js repos. So the policy had to move rather than just be deleted.What changed
Three commits, in order:
includeHiddenbecomes a required boolean onhost.list_filesandhost.list_paths. The server decides it per route: environment and project path search andfiles.list/files.listPathsdefault totrue; thread storage and the two skill enumerators passfalse(the skill read path usesdotfiles: "deny", so listing dot entries there would produce clickable 404s). Monaco passestrueexplicitly; the docs plugin passesfalseto keep.obsidianand similar out of vault sync. The public files routes, SDKFileListArgs, andbb file list|paths --no-hiddenexpose it.excludeNamesbecomes a requiredstring[]on both commands. The daemon only hardcodes.git; the server fills a default set fromapps/server/src/routes/path-list-policy.ts(node_modules,.venv,venv,.turbo,.next,.cache,__pycache__,.DS_Store). This mirrors the always-ignored globs the host-watcher already uses. The public files routes, SDK, andbb file list|paths --exclude <names...>accept a replacement list. Array length and name length are bounded by new@bb/domainconstants.HOST_DAEMON_PROTOCOL_VERSION197 → 198, since both new wire fields are required.Docs updated:
bb-guide-customization.mdtemplate, the bb-cli skill'sthread-operation.md, and the plugin-authoringbackend-sdk.mdreference.host.browse_directory(the home-folder picker) is intentionally unchanged.Deviation from the issue's proposal: no
respectGitignorefield. We want gitignored files in search and the tree; the curated exclude list handles the directories that actually dominate checkouts.How you verified
New tests, which fail before each commit and pass after:
file-list.test.ts: dot entries listed only whenincludeHiddenis true; excluded names skipped at any depth (files and directories);.gitnever listed even withincludeHidden: trueand an empty exclude list.contract.test.ts: list commands are rejected withoutincludeHiddenorexcludeNames, with an empty name, or with more thanFILE_LIST_EXCLUDE_NAMES_MAXnames; protocol version pinned to 198.host-file-routes.test.ts: defaultincludeHidden: trueand default exclude list are filled when the payload omits them; explicitincludeHidden: falseandexcludeNamespass through to the daemon.public-environments.test.tsandpublic-thread-data.test.tsassert the per-route defaults on the wire.Commands run:
All pass. Manual probe of the real
listHostPathshandler against this repo's checkout (the issue's repro root):Fixes #2093
🤖 Generated with Claude Code