Repository navigation
Description
Summary
From a thread in the Personal project, bb thread spawn --parent-self --project proj_personal --machine <remote> creates the child on the parent's machine, reusing the parent's environment. --machine is silently ignored, and adding --new-environment personal or --environment-provider personal-workspace does not help. The same spawn without a parent lands on the remote machine as expected.
Versions and environment
- bb 0.45.0 (desktop app), server on macOS 27.0.1
- Remote machine: Windows PC enrolled with the
manualmachine provider, statusconnected,personal-workspaceprovideravailableon it - Provider: claude-code (Claude Code 2.1.294)
- Parent thread runs in a Personal workspace on the server machine
Steps to reproduce
- Enroll a second machine (any OS) and confirm it is available:
bb environment providers --project proj_personal --machine <remote>→personal-workspace Personal workspace projectless availability: available - From inside a Personal-project thread on the server machine, run:
bb thread spawn --parent-self --project proj_personal --machine <remote> --new-environment personal --prompt "Reply with your hostname." --json
- Inspect the child:
bb thread show <child-id> --json.
Also reproduced with each of these variants:
- no
--new-environment --environment-provider personal-workspacein place of--new-environment personalBB_ENVIRONMENT_IDunset (env -u BB_ENVIRONMENT_ID bb thread spawn …)
Did not reproduce without a parent: the same command without --parent-self provisions a new personal workspace on the remote machine. After that, bb thread update <child-id> --parent-thread <parent-id> attaches it fine.
Expected vs actual
Actual (with --parent-self), returned immediately by spawn:
"environmentId": "env_ga3ygzes3f" <- the parent's environment
environment.hostId: "host_hahfxsy886" <- server machine, not <remote>
environment.path: ~/.bb/plugins/environment-personal-workspace/host-data/workspaces/<parent thread id>
Without --parent-self:
"environmentId": null (provisioning), then "env_ygm6vmtv23"
environment.hostId: "host_yke3wri6qt" <- <remote>
environment.path: C:\Users\<user>\.bb-machines\...\workspaces\thr_mamrpqbdhj
Expected: an explicit --machine that differs from the parent environment's host should produce a new personal workspace on that machine. Reusing the parent environment is fine when no machine is given, or when it is the same machine. If reuse is intended, bb should reject the conflicting --machine rather than ignore it.
Impact: the child agent ran on the wrong machine with a prompt meant for the remote one (here, Windows PowerShell commands ran on macOS) before I noticed and stopped it.
Evidence
- Parent:
thr_99dmaej8n3, environmentenv_ga3ygzes3f(personal-workspace, hosthost_hahfxsy886) - Misplaced children, all with
environmentId: env_ga3ygzes3f:thr_ptgxvac3sj(plain--machine),thr_z4qqibd3vu(--new-environment personal),thr_m69n7iwu45(BB_ENVIRONMENT_IDunset),thr_zpjckpbgff(--environment-provider personal-workspace) - Correct placement without a parent:
thr_mamrpqbdhj, environmentenv_ygm6vmtv23, hosthost_yke3wri6qt
Suspected cause, from reading the code (not confirmed with a test): the first branch of resolveCreateThreadEnvironment returns { type: "reuse", environmentId: parentThread.environmentId } whenever parent and child are both in the Personal project and the request is any personal-workspace form. It never compares the requested machine with the parent environment's hostId:
bb/apps/server/src/services/threads/thread-default-policy.ts
Lines 318 to 330 in f135a00
| const parentThread = args.parentThread; | |
| const hasLiveParent = isLiveParentThread({ parentThread }); | |
| if ( | |
| hasLiveParent && | |
| parentThread?.projectId === PERSONAL_PROJECT_ID && | |
| args.projectId === PERSONAL_PROJECT_ID && | |
| isPersonalWorkspaceEnvironment(args.requestedEnvironment) | |
| ) { | |
| if (!parentThread.environmentId) { | |
| throw new Error("Personal parent thread is missing an environment"); | |
| } | |
| return { type: "reuse", environmentId: parentThread.environmentId }; | |
| } |
isPersonalWorkspaceEnvironment matches project-default, host + workspace.type === "personal", and the personal-workspace provider. So every form of the request, including one carrying an explicit machine, takes the reuse path:
bb/apps/server/src/services/threads/thread-default-policy.ts
Lines 133 to 144 in f135a00
| function isPersonalWorkspaceEnvironment( | |
| environment: CreateThreadEnvironment, | |
| ): boolean { | |
| return ( | |
| environment.type === "project-default" || | |
| (environment.type === "host" && | |
| environment.workspace.type === "personal") || | |
| (environment.type === "provider" && | |
| environment.environmentProviderId === | |
| DEFAULT_ENVIRONMENT_PROVIDER_ID.personalWorkspace) | |
| ); | |
| } |
Possible fix: take the reuse branch only when the request has no explicit machine, or when its machine equals the parent environment's hostId. Otherwise fall through to the normal personal-workspace provisioning on the requested machine.
What you ruled out
- Not Child thread of a parent in a plain (non-git) folder cannot be provisioned #3175: that one covers child provisioning for a non-git project parent and its fix (Reuse non-git parent environments for child threads #3176). This bug is in the separate Personal-project reuse branch.
- Not caused by
BB_ENVIRONMENT_IDin the agent's env: unsetting it does not change the result. - Not machine availability: the same machine works with an unparented spawn, and
bb environment providersreports it available. - The cited branch is unchanged on
mainatf135a00. I reproduced on release 0.45.0, not on amainbuild.
Suggested priority and effort (optional)
Medium. It hits anyone delegating from a Personal thread to another machine, and the child silently runs on the wrong host. Workaround: spawn without a parent, then bb thread update --parent-thread. Effort probably Low.
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
Investigated in bb thread thr_99dmaej8n3 (local install, not publicly linkable).
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 8, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotworkspaces,cli,confirmed-repro.git diff --checkpass. Two files, 95 changed text lines.Honor machine selection for personal child environments (get-bb#5207)