Skip to content

Add Thread Organizer example plugin - #2263

Open
brsbl wants to merge 18 commits into
bb/plugin-runtime-skill-slots-thr_eibej5m9xwfrom
bb/example-thread-organizer-thr_eibej5m9xw
Open

Add Thread Organizer example plugin#2263
brsbl wants to merge 18 commits into
bb/plugin-runtime-skill-slots-thr_eibej5m9xwfrom
bb/example-thread-organizer-thr_eibej5m9xw

Conversation

@brsbl

@brsbl brsbl commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

What was wrong

The repository had no complete reference consumer for plugin-owned thread workflows, leaving native section icons/actions, runtime skill slots, protected unread routing, and durable ordering as disconnected primitives. The remembered default stage was also easy to mistake for a semantic classification; Inbox placement could be undone by read/unread churn; automation-origin roots were excluded; and the settings description aligned its text box rather than the capital R ink edge to the rounded panel.

Title maintenance also had three gaps. It waited for a new hidden worker to become idle, which could match the worker's transient initial state and stop it before its turn produced output. It ran only when a stage key changed, so substantially different work within the same stage could keep a stale title, and independently scheduled transitions each created their own worker. Finally, the stale-result guard preserved a title edited while a worker was running but then dropped the request instead of reconsidering the latest title against current work.

What changed

  • Add the Thread Organizer example with configurable workflow stages, protected Inbox routing, remembered-stage placement, native section icons/actions, CLI phase changes, and agent instructions.
  • Teach the organizer skill to re-evaluate at substantive task starts, resolved indirect kickoffs, scope changes, pre-implementation, implementation/validation transitions, failed validation, and handoff. The default/remembered stage is explicitly mechanical; update_plan does not move workflow stage, while bb organizer phase does.
  • Keep Inbox placement latched through read and unread changes after a thread enters Inbox. Only renewed agent work clears the latch and returns the thread to its remembered stage.
  • Include automation-origin root threads in organization.
  • Make every explicit bb organizer phase <stage-key> call a title checkpoint, including a same-stage refresh that does not move the row or ask the user for permission.
  • Batch pending title requests across threads into bounded groups handled by one invisible worker, and wait for its turn/completed event before reading output so the initial-idle race cannot stop it prematurely.
  • If a title changes while its batch is running, discard only the stale proposal and requeue the thread. The next batch reloads the latest title and current work, rechecks the remembered stage, and leaves the thread eligible for later reassessment after further work changes.
  • Add a direct native sidebar toggle whose stateful tooltip is Focus Section or Show all Sections; plain click focuses or restores the section list.
  • Inset the settings description by the shared rounded-lg radius token and hang Inter's measured capital-R sidebearing so the visible ink edge lands on the corner tangent without an arbitrary pixel nudge.
  • Add the missing Turbo dependency from example typecheck to @get-bb/plugin-sdk#build:types.
  • Preserve PluginAgentConfiguration.skills as string[] and keep experimental_skillSlots optional and experimental. This example alone declares engines.bbPluginSdk >=0.4.17, the first Core SDK containing all required APIs; it consumes the workspace SDK directly and does not vendor or relabel SDK 0.4.10.

Before — exact pre-rebase parent PR head 7f85d7d45

Before — manual workflow has only Unorganized

After — exact pre-rebase UI head bcb110e54

After — Thread Organizer workflow sections and semantic icons

Exact-head settings evidence

Exact head — intent description aligned to the rounded panel tangent and sticky Inbox copy

Final-head recapture note: macOS exhausted application memory while launching isolated desktop dev apps for fbd8a0a37 and the prior top head. The existing pair remains attached, but this PR is not represented as fully merge-ready until the exact-final-head pair is refreshed. The latest title-retry commit is non-visual and does not change those UI states.

How you verified

  • Node v22.23.1 arm64 with Turbo: all 53 focused example tests pass across core guidance, server behavior, app registration, direct sidebar actions, and controller state.
  • Focused title regressions cover the initial-idle race via turn/completed, a substantial same-stage autonomous refresh, two threads sharing one worker, and rename-during-worker → follow-up reassessment using the latest title.
  • Turbo typecheck passes for bb-plugin-thread-organizer-example and upstream generation/build dependencies.
  • Built exact head 02de949f0403e3c40fcbbf9b0140dbc85fc8ffcf with the local source CLI: pnpm bb:dev plugin build examples/plugins/thread-organizer.
  • Removed the generated untracked examples/plugins/thread-organizer/types/ after the build and confirmed the worktree is clean.
  • Focused skill coverage includes an indirect “read this brief” implementation kickoff and a Building → Testing / Deploy transition.
  • Focused server coverage includes Inbox → read stays Inbox → unread stays Inbox → agent active returns to the remembered stage.
  • git diff --check fbd8a0a375288947515dbbd1fa1f573c086493b6..02de949f0403e3c40fcbbf9b0140dbc85fc8ffcf.
  • The attached desktop pair used the same fixture, route, interaction state, and native window bounds at the exact pre-rebase revisions shown above; final-head recapture remains blocked as noted.

Fixes # — no linked issue.

BB-Thread-ID: thr_eibej5m9xw

AGENT GENERATED: by GPT-5.6-Sol

ymichael added a commit that referenced this pull request Aug 21, 2026
## What was wrong

`MachinesSettingsSection` loads host rows and sidebar project metadata
through independent asynchronous queries. The test waited only for
`MacBook Pro` from `sdk.hosts.list`, then synchronously queried for `2
projects` from the still-independent sidebar bootstrap. When the host
query won that race, the rendered row still showed `0 projects`,
producing the same `TestingLibraryElementError` in [PR #2262's app-1
job](https://github.com/get-bb/bb/actions/runs/32530493567) and [PR
#2263's app-1
job](https://github.com/get-bb/bb/actions/runs/32530498050).

## What changed

The project-count assertion now uses awaited `findByText`, synchronizing
the test with the sidebar query that owns the value. The following `1
project` assertion remains synchronous because both counts are derived
from the same resolved sidebar payload. No product behavior, assertion
coverage, wire contract, CLI, or documentation surface changed.

## How you verified

- Reproduced the exact failure before the fix by temporarily delaying
only the sidebar response by 50 ms: the host row rendered with `0
projects`, and the test failed at the `2 projects` assertion. With the
assertion fix under the same forced ordering, the test passed. The
temporary delay is not committed.
- `pnpm exec turbo run test --filter=@bb/app --force -- --run
src/components/settings/MachinesSettingsSection.test.tsx` — 12/12
passed.
- `pnpm exec turbo run test --filter=@bb/app --force` — 418 files
passed; 3,244 tests passed and 3 skipped.
- `pnpm exec turbo run typecheck --filter=@bb/app --force` — clean.
- `pnpm exec turbo run build --filter=@bb/app --force` — clean.
- `git diff --check` — clean.

Fixes # — no linked issue.

BB-Thread-ID: thr_qarynse2fs

> AGENT GENERATED: by GPT-5.6-Sol
@brsbl
brsbl force-pushed the bb/example-thread-organizer-thr_eibej5m9xw branch from f1a913a to bcb110e Compare August 22, 2026 07:09
@brsbl
brsbl force-pushed the bb/example-thread-organizer-thr_eibej5m9xw branch from bcb110e to 5a0313b Compare August 24, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant