feat(protocol): add host browse endpoint for location picking - #46828
Closed
heimoshuiyu wants to merge 1 commit into
Closed
feat(protocol): add host browse endpoint for location picking#46828heimoshuiyu wants to merge 1 commit into
heimoshuiyu wants to merge 1 commit into
Conversation
GET /api/browse/list lists direct children of one host directory through the global FSUtil service without resolving or materializing a location runtime, so directory navigation never boots instances or starts their MCP servers. The workspace picker and the TUI /cd completion navigate through browse.list; the sidebar file tree and @ mention search keep the location-scoped fs routes they depend on.
heimoshuiyu
force-pushed
the
host-browse
branch
from
September 2, 2026 15:32
5eb73be to
4b66294
Compare
Contributor
Author
|
closed in favor of #46970 |
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.
Issue for this PR
Closes #46826
Fixes #46679
Type of change
What does this PR do?
Every location-scoped fs endpoint runs through
LocationMiddleware, so thefirst read against any directory constructs the complete location runtime:
config discovery, plugins, watchers, and one MCP process set per server in that
directory's config chain. Directory navigation used those endpoints. The app
workspace picker preloads every child of the current root, and the TUI
/cdcompletion lists each parent directory while typing. Browsing a directory with
68 subdirectories spawned 68 runtimes and two local MCP servers each (~20 GB).
Navigation is not a location operation, so it gets its own surface:
server.browsegroup with a singleGET /api/browse/list?directory=<abs>served from the global
FSUtilservice: one stat plus one readdir, nolocation resolution, no runtime, no events. Sibling of the server-scoped
groups;
fs.list/fs.read/fs.findare unchanged for work inside anactive location.
the TUI
/cdcompletion navigate throughbrowse.list.@mention search keepfs.list/fs.find: theyrun inside the open location and rely on
filesystem.changedevents and theper-location search index.
current directory (client-side fuzzysort). The previous recursive search was
capped (result limit, visited-directory limit, ignore set), so whether a
match surfaced depended on tree shape. The unused file-mode suggestion path
is removed; no caller passes
mode="file"today.Generated client surfaces regenerated via
bun run generate.This follows #44272's read taxonomy rather than its mechanism: form and
permission queues are runtime-owned state, so #45994 can honestly return an
empty collection when no runtime exists. Directory contents are host-owned
state that exists regardless, so an empty fallback would be wrong and a
conditional host fallback would make
fs.list's view depend on cache state.#44272anticipated this bucket: "Filesystem/VCS capability decomposition... out of scope". This PR is that decomposition for the navigation case,
and it leaves
fs.listfree to become placement-aware (#44568) withoutbreaking pickers.
How did you verify your code works?
packages/server/test/browse.test.ts: lists children (directories first),400 with a readable message for missing and non-directory paths.
browse/listagainst 10 unloaded subdirectoriesreturned 200 ten times with zero
location services bootedlog lines and anunchanged MCP process count; a control
fs/listagainst one moresubdirectory still booted a runtime and spawned its MCP servers, so existing
location behavior is retained.
across protocol/server/client/tui/app.
Screenshots / recordings
No visual change. Picker suggestions are limited to the current directory's
children instead of recursive matches.
Checklist