Repository navigation
Probe environment provider availability per machine in the background - #3436
Merged
SawyerHood merged 1 commit intoSep 10, 2026
Conversation
Reinstate per-machine plugin availability for the environment picker without blocking discovery: listing a project's providers schedules a background probe per connected machine, serves cached answers through a new machineAvailability field, and emits an environment-availability-changed system change when an answer settles. The picker hides providers a machine reports unavailable, keeps the selected one visible with its reason, and remembers each project's list in localStorage so it is trimmed on first open. The CLI prints a machine's availability with --machine. Co-Authored-By: Claude Fable 5.1 <[email protected]>
SawyerHood
force-pushed
the
bb/can-we-make-it-so-that-we-can-show-what-machines-thr_6ak45kwi62
branch
from
September 10, 2026 21:49
15b2c38 to
d94a439
Compare
SawyerHood
deleted the
bb/can-we-make-it-so-that-we-can-show-what-machines-thr_6ak45kwi62
branch
September 10, 2026 21:54
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
The prompt-box environment picker offered every environment provider on every machine, so CoW copy showed up under Macs where its reflink probe can never succeed. Per-machine plugin availability existed briefly (#3227), but #3393 removed it from discovery because the app's per-machine fan-out blocked the picker on the slowest machine's Git inspection and plugin probe. That fix removed the information rather than making it non-blocking: discovery became structural only, availability is always null, and an unsupported choice now fails only at thread creation.
What changed
Server (
apps/server/src/services/environments/provider-machine-availability.ts, new): a background per-machine availability probe. When a project's providers are listed, each structurally eligible provider and connected persistent machine is probed in the background (Git inspection whenrequires.gitCheckout, then the plugin'savailabilityhook), keyed by provider, project, and machine. Listing never awaits a probe: it returns the cached answer or null. Results are cached for ten minutes, cleared when a plugin rechecks, and disconnected machines are never probed. When an answer changes, the server emits a newenvironment-availability-changedsystem change so clients refetch.Contract (
packages/server-contract/src/api/system.ts): each provider now carriesmachineAvailability, a map from host id toavailable,setup-required,unavailable, or null while unknown.availabilityis filled from that map whenhostIdis given. Thread creation still checks the selected provider and machine afresh, exactly as #3393 left it.App:
NewThreadComposerlists providers for the current project and derives each machine's rows frommachineAvailability. The picker hides providers a machine reports as unavailable, except the currently selected one, which stays visible and disabled with its reason so the selection never disappears; setup-required rows stay selectable with their message; unknown rows show as before. The provider list is remembered per project in localStorage through the existing last-known cache and served as placeholder data, so the picker is already trimmed on the first open after a reload. The realtime registry maps the new system change to the provider query.CLI:
bb environment providers --project <id> --machine <id>prints each provider's availability on that machine, and--jsonincludesmachineAvailability. Guide template, bb-cli skill,docs/api_to_audit.md, the Plugin Guide surface text, and the SDK doc comment were updated to describe background probing.No server/daemon wire fields changed, so
HOST_DAEMON_PROTOCOL_VERSIONis unchanged.How you verified
apps/server/test/threads/environment-providers.test.tsrewritten for the new contract: listing answers null first, the background answer is served on the next listing andenvironment-availability-changedfires once; Git inspection runs in the background and a missing branch is reported as unavailable; disconnected machines are not probed; unmet structural requirements never probe; a plugin recheck invalidates the cache and probes again; a throwing hook is reported as unavailable without failing the listing; creation still checks afresh. 43 passed.pnpm exec turbo run typecheckfor server, app, cli, domain, server-contract, sdk, plugin-sdk, plugin-api-map, and templates passes.pnpm exec turbo run testfor cli, server-contract, sdk, domain, templates, plugin-api-map, and plugin-sdk passes. Full server and app Vitest suites pass (the app's turbo test task fails before tests on this machine because its PWA icon check needs a libvips module that isn't installed, so the app suite was run with vitest directly).