Skip to content

Add optional hostId to openNewThread so plugins can preselect the composer's machine #4323

Description

@archr

The workflow

I maintain a sidebar thread-list plugin (a fork of plugins/thread-list) that can organize threads by machine. Each machine group shows a "New thread" action, and I would like it to open BB's root new-thread composer with that machine already selected, the same way the project groups open it with their project selected.

  1. The sidebar is organized by machine; the user is looking at the homelab machine group.
  2. The user clicks "New thread" for that group.
  3. The plugin opens the root composer.
  4. The composer should have homelab selected as the machine. Today it shows the primary host (my Mac Studio), so every thread for another machine needs a manual machine switch.

What happens today

openNewThread accepts projectId, sectionId, environmentId, and focusPrompt, but nothing that selects a machine:

When nothing seeds a machine, the root composer falls back to the primary host (NewThreadComposer.tsx#L720-L741), after the remembered new-thread machine (storedMachineId, L676).

The only way a plugin can steer the machine today is environmentId. That reuses one specific existing environment (the "New thread in environment" affordance from #2842), so it also pins the workspace or worktree. It is not the same as "a new environment on this machine".

What you would expect

An optional hostId on the public navigation API:

actions.openNewThread({
  hostId: "host_abc123",
  projectId, // optional, as today
  focusPrompt: true,
});

When supplied (and the host is known and usable), the root composer should open with that machine selected for a new environment, as if the user had picked it in the machine picker. Omitting hostId keeps the current behavior. If environmentId is also given, environmentId should win, since it already implies a machine.

Context and alternatives

  • Related: Add optional environmentId to openNewThread #2842 (environmentId on openNewThread). This is the machine-level sibling of that request.
  • Workaround considered: passing the environmentId of a recent thread on the target machine. Rejected, because it reuses that environment instead of creating a new one there.
  • Also considered: experimental_NewThreadComposer with a default machine. As Add optional environmentId to openNewThread #2842 explains, that composer keeps component-local provider and model state and does not follow app-level new-thread customizations, so the root composer is the right target.
  • Tested against bb 0.43.4 (desktop) with plugin SDK 0.5.9. Code references are permalinks to main at 98706229. I have not changed bb itself; this comes from the plugin side, where openNewThread has no host parameter.

AGENT GENERATED

Activity

  1. added a commit that references this issue on Sep 25, 2026
    890775c
  2. added
    plugins
    ui
    on Sep 25, 2026
  3. bb-slop-cop commented on Sep 25, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Type Feature, Priority Low, Effort Medium, and labels plugins, ui. No existing classification values needed preserving. Verified the final Type is Feature.

    This adds a plugin SDK capability; manual machine selection remains available. SDK and composer integration warrants Medium effort. Reproduction and fix steps were skipped because this is a feature request; no pull request was opened.

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

    pluginsui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions