Repository navigation
Start project-default threads on the project's machine when the primary host has no source - #6054
Merged
ymichael merged 1 commit intoOct 22, 2026
Conversation
…ry host has no source A project-default thread always resolved on the primary host, so a project whose only source lives on another machine failed with 404 "Project has no local-path source for host". When the primary host has no source of the project, use the persistent machine that holds its default source, or its oldest source on a persistent machine. Projects with a source on the primary host keep today's placement; an offline project machine fails with 502 instead of moving the thread. Fixes get-bb#4446
This was referenced Oct 21, 2026
alexandre-vl
added a commit
to alexandre-vl/bb
that referenced
this pull request
Oct 23, 2026
…-environment After get-bb#6122 moved the composer into plugins/composer, the carry merged after bb/project-default-environment through three merge bases whose virtual base conflicts in plugins/automations/detail-view.tsx, so Fork Sync skipped it. Merged first, its bases are main and two commits upstream already has (get-bb#6054, get-bb#6005), and bb/project-default-environment then arrives already included.
alexandre-vl
added a commit
to alexandre-vl/bb
that referenced
this pull request
Oct 30, 2026
- bb/daemon-self-update-node-npm-cli (get-bb#6083): superseded by upstream get-bb#6194. - bb/project-default-source-host (get-bb#6054) and bb/explain-failed-automations-thr_agcnkvvvke (get-bb#6005): merged upstream; each merges into main with main's own tree. - carry/automation-environment-composer: it only reconciled the composer branch with explain-failed, and the updated bb/automation-environment-composer merges without it. - carry/github-plugin-inbox: it breaks bb-plugin-github#typecheck on current main; the updated github-plugin-inbox carries the inbox itself.
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
A thread created with no environment (
project-default) and no live parent always resolved to the primary host. Examples are a Tasks preset, an automation run, orbb thread spawnwithout an environment flag.resolveProjectDefaultThreadEnvironmenttookrequireConnectedPrimaryHostIdand then looked up the project's checkout on that host. It never checked that the project had a checkout there. A project whose only checkout lives on another machine, such as a laptop, therefore failed with 404Project has no local-path source for host(#4446).What changed
thread-default-policy.ts: the newresolveProjectDefaultHostIdkeeps the primary host whenever it has a checkout of the project, so today's placement is unchanged for those projects. Otherwise it takes a persistent machine that holds a checkout. It skips destroyed and removing machines, and prefers the project's default source, then the oldest one. That machine is readied the way an explicitly chosen one is (ensureHostSessionReadyForWork):project-sources.ts:getProjectSourceOnPersistentHost, one join query.bb guide threadssays where a thread with no environment flag starts.HOST_DAEMON_PROTOCOL_VERSIONbump.How you verified
A new
project-default machineblock runs against the real server and a migrated SQLite database. Each test creates a project-default thread through the public API. The "main" column comes from running the same file againstmain's server code (b143a2286): 4 tests failed and 2 passed.mainexpected 404 to be 201expected 404 to be 201expected 404 to be 502expected 404 to be 201If the fix only requires a connected machine instead of waking it, the suspended-machine test fails with
expected 502 to be 201.pnpm exec turbo run typecheck lint --filter=@bb/serverpassed.The six server suites that cover project-default placement passed (177 tests):
thread-default-policy,environment-providers,public-threads.project-default,thread-runtime-config,provider-managementandplugin-sdk.Before the wake was added,
pnpm exec turbo run typecheck test --filter=@bb/server --filter=@bb/db --filter=@bb/templatespassed@bb/server3631,@bb/db632 and@bb/templates46.No UI change, so there are no screenshots; the status codes above are the before and after. I did not reproduce it in a live instance, which needs a second enrolled machine.
Fixes #4446