Repository navigation
Slash menu, skill list and skill open: one host round trip each - #8123
Merged
ymichael merged 1 commit intoNov 24, 2026
Merged
Conversation
…ost call Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/slash-menu-skills-one-host-round-trip-thr_v7zgfxv8tf
branch
November 24, 2026 22:20
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
What was wrong
Opening the slash-command menu, listing skills, and opening one skill each cost several serial host round trips. Before every native-root scan the server made a separate
plugin.host.call resolveNativeRoots, cached for 10 s, and only then senthost.list_commands/host.list_skills. The skills index also sent onehost.list_skillsper visible provider plus one for shared roots. Opening a skill rebuilt that whole index twice, once for content and once for files, just to map a skill id to a path. On a Connect-tunnelled host each serial wave costs ~200 ms (audit findings #2 and #3,thr_ejgucea7p3/report.md). Finding #4, frontmatter-only project skill reads, is handled in a separate thread.What changed
HOST_DAEMON_PROTOCOL_VERSION281 → 282.host.list_commandsnow takes{ cwd, provider: { providerId, declaredRoots, resolver }, resolution: { contributedEnv, timeoutMs } }.host.list_skillstakes{ cwd, providers: [...], sharedRoots, resolution }and returns{ workspaceSkills, sharedSkills, providers: [{ providerId, skills }] }.resolveris{ pluginId, generation, artifact }or null. The daemon calls the plugin'sresolveNativeRootsin-process through itsPluginHostManager, inside the same request as the scan. It cancels that call if the listing is cancelled. A failed, malformed, or unavailable answer falls back to the declared roots with a warning, as the server did before.services/providers/native-roots.ts): which providers are scanned, which plugin resolves, the host env, and a 10 s resolver cap that leaves the scan time inside the first retry attempt. The server-side resolved-roots cache (ProviderNativeRootsCache) is deleted because resolving is no longer a separate round trip.services/skills/skill-listing.ts):host.list_skillsreplaces the per-provider calls and the separate shared-roots call..bb/skillsis scanned once instead of once per provider. It is now also listed when no provider has native roots.@bb/async-cache, 5 min) is refreshed by every listing. Content and file reads resolve the id from it and rebuild once only for an id the last listing didn't have. Writes and deletes always rebuild first. Plugin settings changes clear it.docs/api_to_audit.mdand theexperimental_nativeRootsHostContractJSDoc now say the daemon resolves per listing, uncached. Plugin SDK bumped to 0.6.197 for the JSDoc change.How you verified
Measured on two real servers, main at merge base
af25b0b5a60vs this branch, each with a fresh data dir (no~/.bb). Each server had a second enrolled daemon behind a TCP latency proxy adding 100 ms each way (~200 ms RTT). The proxy stripspermessage-deflatefrom the daemon's upgrade, reads server→daemon frames, and countshost-rpc.requests. Input was the same bb checkout (9.bb/skills, real~/.claudeetc.) andprovider=claude-code, with 8 samples per action after warm-up.Remote host (~200 ms RTT): median wall time / host RPCs per action
list_commands, ‖read_workspace_agent_context)list_skills)read_file‖list_files)Local host (primary daemon, no proxy), median:
The warm slash menu still makes 2 RPCs in one parallel wave:
host.list_commandsandhost.read_workspace_agent_context. Folding the second one in overlaps finding #4's change to that command, so it is left for that thread. Every action is now a single wave. The remaining ~100 ms over RTT on the skills list is server-side index work (listServerSkillshashing), not host traffic.Tests:
apps/server/test/public/public-project-skills.test.tsadds "opens a listed skill with one host read…". It asserts that a listing is onehost.list_skills, that content + files after it are exactlyhost.read_file+host.list_files, and that an unknown id re-lists once. It fails on main, where every open re-lists.apps/host-daemon/src/command-handlers/list-skills.test.tscovers the batched handler with a fake plugin host: the.bb/skillsroot is listed once, shared roots and resolved roots are scanned, a throwing / malformed / missing runtime falls back to declared roots with a warning, and cancelling the listing cancels the resolver call.native-roots.test.ts, the commands, workspace-routing and contract tests are updated to the new wire shape.pnpm exec turbo run typecheck lint --filter=@bb/server --filter=@bb/host-daemon --filter=@bb/host-daemon-contract --filter=@get-bb/plugin-sdk --filter=@bb/integration-testspasses. So do the targeted vitest runs above, plustests/integrationnative-roots-golden. CI runs the full suites.🤖 Generated with Claude Code