Skip to content

Allow disabling managed worktree environments #2285

Closed

Description

@tom-pang

Request

A supported way to disable bb's managed-worktree environment provisioning — per server, per project, or both — so that only unmanaged (existing-path) environments are used.

Use case

I manage my own workspaces outside bb (jj workspaces via a custom tool, one directory per branch under a fixed layout). bb threads work fine in these via unmanaged environments ({ type: "host", workspace: { type: "unmanaged", path } }), and I have a plugin that wires my workspace tool to thread spawning.

What I can't do is stop bb offering/creating managed worktrees. Risk surface: an agent (or I, on autopilot) spawns a thread into a managed git worktree of a jj-colocated repo, work lands somewhere my tooling can't see, and cleanup semantics (bb destroys the worktree when the last thread archives) don't match how I manage those directories.

What I checked (plugin SDK, bb 0.39-ish)

No existing mechanism:

  • appSettingsSchema — nothing about workspace provisioning.
  • experimentsSchema — only claudeCodeMockCliTraffic, editMessages, newOnboarding, providerSessionReaping.
  • Backend: managed-worktree is a core arm of the environment discriminated union; plugins can't strip it.
  • Frontend: no slot to replace/hide the native new-thread environment picker. experimental_newThreadPanelAction only adds beside it; experimental_NewThreadComposer's defaultEnvironment only seeds (user-changeable). Replacement slots exist for thread list / file opener / thread header / provider icon — not the environment picker.

Proposal (any of these works for me)

  1. A setting (server or project level) that disables managed-worktree creation and hides "new worktree" from environment pickers.
  2. A plugin-replaceable environment-picker slot, so a plugin can present only the options it wants.
  3. At minimum, a server flag that makes managed-worktree provisioning fail fast with a clear error, so accidental spawns surface immediately instead of creating worktrees.

Happy to elaborate on the jj-workspace setup if useful.

Activity

  1. added
    workspaces
    on Aug 23, 2026
  2. SawyerHood commented on Sep 9, 2026

    @SawyerHood
    Collaborator

    Closing as addressed by the environment-provider implementation in #3227. Managed Git worktrees are now supplied by a plugin, and requests for unavailable environment providers fail explicitly. The maintainer has accepted this implementation as sufficient to close this request. Disabling the plugin and checking the resulting picker/provisioning behavior was not freshly exercised during this audit.

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

    workspaces

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions