Skip to content

Let Personal threads share a folder their parent moved into - #7258

Merged
ymichael merged 2 commits into
mainfrom
slopcop/issue-7256
Nov 9, 2026
Merged

ymichael merged 2 commits into
mainfrom
slopcop/issue-7256

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

A Personal thread that moved into an attached folder with update_environment_directory could not spawn Personal children: every variant returned 409 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

  • Delete the reuse rule (assertReuseWorkspaceProjectCompatibility) and the fork-only exception plumbing in thread-request-eligibility.ts, thread-environment-placement.ts and thread-create.ts.
  • Children of a moved Personal parent now share the parent's folder, the same way forks already did. A parent still in its personal workspace keeps sharing it as before, and --machine on another host still gets a fresh workspace (Honor machine selection for personal child environments #5207).
  • Deviation from the issue's proposed fix and this PR's first commit: instead of falling back to a fresh, empty personal workspace when the parent has moved, the child follows the parent. That keeps children and forks consistent and removes an exception rather than adding one. It also makes --environment <parent env id> work. The first commit's guard is reverted.
  • Still blocked: starting a new Personal thread at an arbitrary path (--environment <path>, a separate 400 check), and a standard project thread sharing a personal workspace (different-project check, now covered by a test).
  • No wire, schema, CLI or doc changes.

How you verified

  • Tests:
    • The three environment-providers.test.ts cases now expect the child to share the attached parent's environment. They fail on main with the 409.
    • A new case asserts that a standard project thread reusing a personal workspace still gets 409 "Environment belongs to a different project".
    • The fork test that asserted the exception's narrowness is removed along with the exception.
  • pnpm exec turbo run test --filter=@bb/server -- test/threads test/public: 117 files, 1275 tests pass. turbo run typecheck --filter=@bb/server passes; oxlint and prettier are clean on the changed files.
  • Live, on a pnpm start:worktree server, a claude-code Personal thread moved itself to /tmp/bb7258-scratch:
From the moved parent main this PR
child, no env flag 409 shares /tmp/bb7258-scratch
child, --new-environment personal 409 shares /tmp/bb7258-scratch
child, --environment-provider personal-workspace 409 shares /tmp/bb7258-scratch
child, --environment <parent env id> 409 shares /tmp/bb7258-scratch
fork (no flags / --environment <parent env id>) shares shares /tmp/bb7258-scratch
fork --new-environment personal fresh workspace fresh workspace

A running child and a running fork each replied /private/tmp/bb7258-scratch to pwd.

Fixes #7256

AGENT GENERATED

🤖 Generated with Claude Code

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]>
@ymichael ymichael changed the title Guard automatic Personal workspace reuse during child creation Let Personal threads share a folder their parent moved into Nov 9, 2026
@ymichael
ymichael merged commit 260bb2c into main Nov 9, 2026
31 checks passed
@ymichael
ymichael deleted the slopcop/issue-7256 branch November 9, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants