Skip to content

Machine providers: durable lifecycle and shared plugin APIs - #3274

Open
ymichael wants to merge 52 commits into
mainfrom
bb/machine-provider-apis
Open

Machine providers: durable lifecycle and shared plugin APIs#3274
ymichael wants to merge 52 commits into
mainfrom
bb/machine-provider-apis

Conversation

@ymichael

@ymichael ymichael commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Environment providers can choose a workspace on an existing host, but plugins also need a shared way to allocate a machine, enroll its daemon, obtain server access, and recover or remove it after cancellation, idle suspension, vendor expiry, or a restart. PR #3231 combined those contracts with several independent integrations.

What changed

Adds durable machine launches, encrypted enrollment/bootstrap, server-access grants, lifecycle observation and recovery, readiness checks, machine environment/credential contributions, and their UI, CLI, and SDK surfaces. Includes the shared SSH executor and compatibility updates to existing environment and agent plugins. Includes the built-in manual provider and Existing machine picker, enrollment command flow, and lifecycle tests from #3275. Includes Connect server-access grants, interrupted redemption recovery, and the Cloud machine-code lookup endpoint from #3280. Optional compute providers remain separate companion PRs directly atop this branch.

Rebased onto merged #3227 (main at 426ed78, including #3268), preserving its plugin ownership checks, path reservations, and unknown-hook recovery behavior. Machine restore tracking uses those hook identities and does not replay an unknown hook after daemon restart. Plugin SDK is 0.4.61 (from main's 0.4.50); daemon protocol is 195 (from 193).

Consolidates the eight unpublished Drizzle migrations into one generated 0114_machine_providers migration and snapshot. It preserves the remote-host manual-provider backfill and the local host exclusion. Existing released migration history is unchanged. The included manual plugin supplies the Existing machine creation flow and lifecycle handling of backfilled hosts. Optional vendor integrations can land independently afterward.

Companion PRs: ssh, tailscale, digitalocean, modal.

The machine cleanup hook is named reconcileCleanup under bb.experimental_machines. Desktop startup failures are also emitted to stderr so Linux AppImage smoke failures expose the runtime error. Manual-specific command construction and UI still have core integration points; this is not a complete extraction of that presentation into the plugin.

How you verified

  • Repository-wide Turbo typecheck/lint: 97 tasks passed.

  • Turbo builds and typechecks for app, server, host daemon, CLI, and Plugin SDK: 15 tasks passed.

  • Database: 451 tests, including upgrading the merged environment-provider schema with existing local/remote hosts, foreign-key integrity, and repeat startup.

  • Focused server machine/environment/readiness and registration regression suites: 222 tests passed after updating fixtures for Environment providers: plugins own where threads run #3227's plugin ownership contract.

  • Machine UI: 73 tests passed. Fake environment/setup integration: 9 passed. Shared SSH transport: 13 passed.

  • Rebased combined source: CLI 596, daemon 595, Plugin SDK 250, SDK 108, server-contract 69, daemon-contract 55, API-map 76 tests passed.

  • Full base server suite: 2,487 tests passed (244 files passed, one skipped). After incorporating the newer main reconnect fix, repeated proxy tests (10) and session/machine regression tests (81) passed.

  • No live paid-vendor allocation or existing test-database migration was performed. The original Machine providers: durable creation, reusable enrollment and three machine plugins #3231 checkout/test instance was preserved.

  • Manual integration: 36 lifecycle/transcript/built-in tests passed; plugin/server Turbo typechecks and plugin lint passed.

  • Isolated dev app rebuilt; browser verified Existing machine selection, transient enrollment command display, and explicit cancellation. Server/daemon health passed. No external host enrolled.

  • Current CI result is not asserted here; no check polling was performed for the integration.

  • Connect integration: 107 plugin tests and 117 Cloud app tests passed, plus both Turbo typechecks. Rebuilt isolated app exposes Connect as setup-required; Remote access pairing UI rendered. No production pairing or Cloud deployment performed. Live interrupted-redemption recovery requires the included Cloud endpoint to be deployed.

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/machine-provider-apis branch from 6f566e7 to a8bf1f6 Compare September 9, 2026 03:37
ymichael and others added 20 commits September 8, 2026 20:48
The access gate reused MachineAccessSettings through a presentation prop
that branched in seven places, and titled the dialog "Set up machine
access" while MachinesSettingsSection still expected "Add a machine",
failing CI.

Split the component into a useMachineAccess hook with a picker and a
details view that carry no presentation branching, and let each caller
supply its own chrome. The gate now explains why it blocks, holds its
header until the access check resolves so no heading swaps, matches the
label weight of neighbouring fields, sizes the save button to the input,
marks the setup link as navigation, and stacks its action full width
through a container query.

Validation no longer reports a failed save as a malformed URL, clears a
stale error when the address is edited, and renders errors as alerts in
destructive text instead of muted help text.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant