Repository navigation
Consolidate environment provisioning into one durable lifecycle - #3443
Merged
ymichael merged 6 commits intoSep 10, 2026
Merged
Conversation
ymichael
deleted the
bb/apply-one-host-row-design-elsewhere-thr_crci7kz3hu
branch
September 10, 2026 23:21
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
Workspace creation was split between an
environment_launchesrow, an environment row, and in-memory thread provisioning contexts. Separate provider and daemon orchestration paths handed the same lifecycle between them, making restart recovery, cancellation, and retries depend on duplicated state. A provisioning sweep could fail a workspace while its provider was still creating it.What changed
creating, daemon attachment/setup (provisioning), andready, and handle cancellation, cleanup, and retirement.threads.startup_context; derive provisioning stage from rows and resolve placement directly into the environment reservation.owner_thread_id,attempt,status_message,pending_log, andclaim_path. Attachment clears ownership atomically with the thread's environment binding. Creation failures are terminal; explicit retries reuse the row with a new attempt. Remove duplicate phase/attachment flags and the transient-create retry ladder.0116_majestic_swordsman.sqland its Drizzle-generated snapshot. It transfers unfinished allocations and startup requests, then dropsenvironment_launches.creating; daemon wire payloads are unchanged, so no protocol bump is needed.How you verified
--maxWorkers=4: server 2,400 passed / 1 skipped; db 483 passed. The default-worker run hit the previously observed five-second provider-discovery timeout.bbCLI against a disposable Git project with real Codex and Cursor providers. Verified file reads and final assistant responses, fresh worktree creation, checkout/shared-environment reuse, setup failure and same-row retry, server restart during setup, cancellation before and after attachment, retirement/unarchive, and directory removal. The live run found the setup-retry and reconnect fixes, then passed their repeated scenarios. It preceded the final shared-workspace cancellation review fix. Claude authentication was expired, so its agent-execution check was blocked.Commands included
pnpm exec turbo run typecheck,pnpm exec turbo run test --filter=@bb/server --filter=@bb/app --filter=@bb/db --filter=@bb/cli --continue --force,pnpm exec turbo run typecheck lint test --filter=@bb/server --filter=@bb/db, and the final suite rerunpnpm exec turbo run test --filter=@bb/server --filter=@bb/db -- --maxWorkers=4. Neither server nor db defines a lint task.