Skip to content

A folder used by a Personal thread can never be opened as a project — "Workspace path is already attached to a different project" #1043

Closed

Description

@patleeman

A folder used by a Personal thread can never be opened as a project — "Workspace path is already attached to a different project"

What I was trying to do

I was working on a repo inside a Personal thread and asked it to switch its working directory to that repo (normal, supported usage). Later I created a proper bb project from that same folder, expecting to open it and work on it there.

What happened

Creating the project succeeded, but every attempt to open it failed with:

Workspace path is already attached to a different project

The project was effectively unusable — starting any thread in it hit the same error, every time. Nothing in the UI or CLI said which project owned the folder, and there was no supported action to resolve it. The only way I could unblock myself was editing bb's database by hand.

What I expected instead

I understand a folder probably shouldn't be owned by two projects at once — that rule makes sense. The issue is that this state is created silently, reported confusingly, and can't be fixed in the app. It would help if any of these were true:

  1. Creating a project (or adding a source) at a folder already claimed by another project warns or rejects up front, ideally with an "adopt this folder" option; or
  2. The open error says which project owns the folder and how to resolve it; and
  3. There is a supported way to transfer or release a folder's ownership — today there is none.

Steps to reproduce

  1. In a Personal thread, ask the agent to switch its working directory to an existing repo folder (uses the update_environment_directory tool).
  2. Create a new project from that same folder (bb project create --root <path>, or the UI).
  3. Open the new project / start a thread in it.
  4. It fails with "Workspace path is already attached to a different project" — and keeps failing on every open.

Why this happens (technical notes for maintainers)

  • Switching a thread's directory records the folder as a workspace owned by that thread's project (thread-environment-directory.ts). From a Personal thread, the folder therefore becomes owned by the Personal project — permanently, even after the thread is archived.
  • That ownership is never released: project deletion skips non-managed workspaces (project-deletion.ts), and workspace cleanup only handles managed ones (environment-cleanup-internal.ts). Deleting the owning project wouldn't free the folder either.
  • Project creation and source-add never check existing workspace ownership (routes/projects.ts), so the conflict only surfaces later, at thread open, in thread-create.ts (existingUnmanagedEnvironmentIntentByHostPath → 409).
  • There is no API, CLI, or UI to transfer or release the claim — hence the manual database edit.

Suggested directions

  1. Validate at project-create / add-source time, and offer to adopt the folder if it's owned by another project.
  2. Make the open error actionable: name the owning project and point to a supported fix.
  3. Avoid permanently claiming a folder when a Personal thread switches into it (or release the claim when the owning thread is archived/deleted).

Environment

  • bb 0.35.1 (desktop app)
  • macOS
  • Local repo folder on the primary machine

Happy to provide more details, logs, or help test a fix.


Note: this report was drafted with the help of an AI agent. The reporter is actively involved and will respond to any follow-up questions or requests for details.

Activity

  1. SawyerHood commented on Aug 6, 2026

    @SawyerHood
    Collaborator

    TY for the report! Let me dig in

  2. added a commit that references this issue on Aug 6, 2026
    bed4506
  3. added theissue type on Aug 13, 2026
  4. added a commit that references this issue on Aug 14, 2026
    6e2efa4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions