Repository navigation
Let Personal threads share a folder their parent moved into - #7258
Merged
Merged
Conversation
Remove the reuse rule that required Personal threads to share only bb-created personal workspaces. It predates update_environment_directory, which made a Personal thread in an attached folder a normal state; since then every flow that shares that folder (forks, then children) hit a 409. The project half of the rule is unreachable since #3227 because the different-project check rejects it first. Drop the fork-only exception and the PR's fresh-workspace fallback with it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 Personal thread that moved into an attached folder with
update_environment_directorycould not spawn Personal children: every variant returned409 Personal project threads must reuse a personal workspace(#7256). The cause is a reuse rule from c35a710 (May 27) that let Personal threads share only bb-created personal workspaces. It was written before threads could move (79f409a, June 24); moving made "a Personal thread in an attached folder" a normal state, but the rule was never revisited. Forks hit the same 409 and got a fork-only exception in #1212 (allowUnmanagedPersonalProjectReuseEnvironmentId); children of moved parents hit it now. The rule's other half, "standard project threads cannot reuse personal workspaces", has been unreachable since #3227: personal workspaces always belong to the Personal project, so the earlier "Environment belongs to a different project" check rejects that case first.What changed
assertReuseWorkspaceProjectCompatibility) and the fork-only exception plumbing inthread-request-eligibility.ts,thread-environment-placement.tsandthread-create.ts.--machineon another host still gets a fresh workspace (Honor machine selection for personal child environments #5207).--environment <parent env id>work. The first commit's guard is reverted.--environment <path>, a separate 400 check), and a standard project thread sharing a personal workspace (different-project check, now covered by a test).How you verified
environment-providers.test.tscases now expect the child to share the attached parent's environment. They fail on main with the 409.pnpm exec turbo run test --filter=@bb/server -- test/threads test/public: 117 files, 1275 tests pass.turbo run typecheck --filter=@bb/serverpasses; oxlint and prettier are clean on the changed files.pnpm start:worktreeserver, a claude-code Personal thread moved itself to/tmp/bb7258-scratch:/tmp/bb7258-scratch--new-environment personal/tmp/bb7258-scratch--environment-provider personal-workspace/tmp/bb7258-scratch--environment <parent env id>/tmp/bb7258-scratch--environment <parent env id>)/tmp/bb7258-scratch--new-environment personalA running child and a running fork each replied
/private/tmp/bb7258-scratchtopwd.Fixes #7256
🤖 Generated with Claude Code