Skip to content

Plugin-embedded NewThreadComposer: an unseeded or not-yet-known project seed silently resolves to the personal project instead of the remembered new-thread project #5340

Open

Description

@cristoslc

Summary

When a plugin embeds experimental_NewThreadComposer without a defaultProjectId seed, the host resolves the picked project to the personal project (proj_personal: the picker shows "No project", and submitting records a personal-project thread). It never consults the remembered last-used new-thread project that the root compose surface keeps in localStorage, so every plugin-embedded composer is silently weaker than bb's own new-thread view. A second symptom in the same code region: a seeded project id the picker's project list does not (yet) contain is also silently resolved to proj_personal and submitted — a spawn is recorded against the personal project instead of failing loud or waiting for the list to settle.

This was found while investigating the Focus Board plugin's "New thread" button (filed plugin-side: cristoslc/bb-plugin-focus-board#24) but lives in bb's composer code, not the plugin.

Versions and environment

  • bb 0.46.0 (desktop app), macOS 26.2 — observed on the installed 0.46.0 webapp bundle and confirmed in source at tag desktop-v0.46.0
  • Focus Board plugin [email protected] at commit 92dd536 (has the maximize hand-off; the seeding helper there is unchanged from its released 1.1.0)
  • ACP provider (acp-opencode); worktree environment, bb Connect paired

Steps to reproduce

  1. Enable/serve the Focus Board plugin and open its board panel (a plugin app panel, not the root compose view). Leave the board unfiltered (its default view).
  2. Click New thread on the board toolbar. The composer dialog opens with the project picker on "No project" (the personal project) and the environment row on the default "Project checkout" kind.
  3. For contrast, open bb's own new-thread view (sidebar "New thread"): its picker starts on the remembered pick (bb.root-compose.project-id, initialized from PERSONAL_PROJECT_ID), not unconditionally on personal.
  4. Closest faithful repro for the seed-downgrade sub-symptom (code-verified, not live-reproduced): render the plugin composer with defaultProjectId: "<an id not in the project list>" and submit; the resolved request's projectId is proj_personal.

Did not reproduce with: bb's own sidebar/root compose surface (that path remembers); the Focus Board maximize hand-off (it omits an undefined seed, so the main view applies its remembered pick — the divergence is what exposed this).

Expected vs actual

Expected: a composer embedded in a plugin resolves an absent or temporarily-unresolvable project seed to something derived from the operator's context (the remembered new-thread pick is the natural candidate), and a seeded id the picker cannot resolve either defers the spawn until the project list settles or fails loudly — never silently spawns into the personal project.

Actual (0.46.0, tag desktop-v0.46.0):

// apps/app/src/components/plugin/PluginNewThreadComposer.tsx#L29-L37
const [pickedProjectId, setPickedProjectId] = useState<string | null>(
  defaultProjectId ?? null,
);
// ...
// apps/app/src/components/plugin/PluginNewThreadComposer.tsx#L62-L73
<NewThreadComposer
  projectId={pickedProjectId}
  onProjectChange={setPickedProjectId}
  draftStorage={{ kind: "plugin-new-thread", key: composerKey }}
  selectionScope="component-local"
  seed={seed}
  resetKey={defaultProjectId ?? null}
  ...

// apps/app/src/components/promptbox/NewThreadComposer.tsx#L512-L525
const requestedCandidate = requestedProjectId ?? PERSONAL_PROJECT_ID;
// ...
const projectId = useMemo(() => {
  if (isProjectlessProjectId(requestedCandidate)) return PERSONAL_PROJECT_ID;
  if (!projects || !replayKnowsCandidate) return requestedCandidate;
  return candidateKnown ? requestedCandidate : PERSONAL_PROJECT_ID;
}, ...)

The unseeded pick becomes proj_personal; the picker trigger for the null state renders "No project" (apps/app/src/components/pickers/ProjectSelector.tsx#L118); a not-yet-known seeded id takes the same PERSONAL_PROJECT_ID branch; and the create path inserts the requested project id verbatim (apps/server/src/services/threads/thread-create.ts#L382), so a personal-project thread + personal workspace is recorded with no re-derivation. The root surface's remembered pick (bb.root-compose.project-id, apps/app/src/lib/root-compose-selection.ts#L12-L31, consumed only in apps/app/src/views/RootComposeView.tsx#L398-L433) is never read on the plugin-embedded path — the plugin mount runs selectionScope: "component-local", so it does not share the root's selection scope either.

Execution defaults are not affected: once any project is picked, the project's remembered execution defaults apply as documented. The gap is exactly the project pick.

Evidence

What you ruled out

Suggested priority and effort

Low–Medium — hits any plugin embedding the composer without a seed (and any plugin seeding an id the picker cannot resolve); workaround exists (the plugin computes its own seed, as Focus Board is about to); no data loss; effort Low — either expose the remembered pick to plugin-embedded composers (a documented useRememberedProjectId()-style API or a "remembered" defaulting mode reusing root-compose-selection machinery), or resolve an undefined defaultProjectId through the remembered pick per selection-scope policy while keeping the explicit "Don't work in a project" as the personal id, and make an unresolvable SEED fail loud or defer instead of downgrading.

Checks

AGENT GENERATED — investigation thread thr_kv6syqtv36 in bb (Focus Board project), adversarial verification thr_dyxsymisdv.

Activity

  1. added theissue type on Oct 10, 2026
  2. added
    ui
    plugins
    confirmed-repro
    on Oct 10, 2026
  3. bb-slop-cop commented on Oct 10, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Low · Labels: ui, plugins, confirmed-repro.
    • Report: Reproduction and root cause.
    • Verdict: REPRODUCED · Confidence: high, repeated in two clean checkouts of trusted main (e9ad6b0e34736).
    • Root cause: Plugin project state initializes to null without a seed; shared reconciliation also converts an unknown seed in a fresh project list to personal before assembling the submission.
    • Regression evidence: Two request-boundary tests fail with personal-project submissions; four controls pass. Loading/replayed unknown projects already have protection. No live desktop/provider spawn is claimed.
    • No PR: Choosing the omitted-seed default and invalid-seed policy requires a product decision, so the decision-free simple-fix gate is not satisfied.

    AGENT GENERATED

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

    confirmed-repropluginsui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions