Repository navigation
Conversation
ymichael
force-pushed
the
bb/message-actions-role-and-availability-filters-co-thr_zp3p6kd6tc
branch
2 times, most recently
from
November 25, 2026 00:19
b4ed1ca to
8072e74
Compare
ymichael
force-pushed
the
bb/message-actions-role-and-availability-filters-co-thr_zp3p6kd6tc
branch
2 times, most recently
from
November 26, 2026 05:05
c41b80d to
31f00f4
Compare
2 tasks done
ymichael
force-pushed
the
bb/message-actions-role-and-availability-filters-co-thr_zp3p6kd6tc
branch
2 times, most recently
from
December 1, 2026 05:42
358d77b to
18e8e6c
Compare
bb's Copy, Edit, Copy link, Add to chat and Fork were hand-wired into the
action row and the selection menu, while slots.messageAction could not say
"assistant only" or "only when available", so plugin actions showed on
messages where they could not work. ThreadChat's messageActions was a second
shape with roles and a narrower run.
The slot now takes experimental_roles, experimental_placements ("inline",
"menu", "selection"), experimental_order and experimental_availability, and
its context carries experimental_invokedFrom, experimental_selectedMarkdown
and experimental_messageRequests (bb's own addToChat, edit and fork). The
message reference adds experimental_settled, experimental_attachments and
experimental_imageUrls, and experimental_copyToClipboard takes an imageUrl.
bb's five actions are registrations in core-contributions/message-actions.ts
and the action row and selection menu render only the resolved list.
ThreadChat takes experimental_messageActions in the same shape; the old
messageActions is deprecated and adapted. Side chat and Conductor declare
their roles and availability.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ExperimentalMessageRequests.addToChat was a second public way to edit the thread draft beside the composer handle message actions already receive. Drop it. The availability input now carries the same `composer` that `run` gets, and bb's Add to chat (row menu and selection menu) is `composer.replace` with the new `experimental_appendQuoteToDraft`, then `composer.focus()`. The quoting code moves from client-core into the SDK's composer draft transforms so there is one copy: the public export, the test harness, diff/file/terminal Add to chat, root compose and the retired addQuote all use it. Message actions also bind to the inline editor of the thread's own queued message while one is open, so Add to chat quotes into it instead of disappearing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ExperimentalMessageRequests.fork handed bb's internal fork flow to message actions even though plugins already fork with sdk.threads.fork. Drop it and give the availability input a `canFork` flag instead. bb's Fork into new thread is now sdk.threads.fork then navigate.toThread, the same path Conductor uses. The fork route takes over what only bb's button did: it resolves the source's next-turn model and reasoning level (picker choice before last turn) and copies the source's section and pin. The plugin-bound fork puts the new thread in the app's cache before the caller navigates, as bb's button did, and useForkThreadFromMessage is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
experimental_messageActions takes the same registrations as slots.messageAction, so the old ThreadChatMessageAction shape was a second way to declare the same thing. Remove it from the SDK types, docs and test harness. Compiled plugins that still pass it keep working: PluginThreadChat adapts each entry into an inline-only registration and warns once per plugin to move to experimental_messageActions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
experimental_roles, experimental_placements and experimental_availability
gave message actions a decision function and a run function that received
different objects, flags with no reactive source, and a one-member
messageRequests bag. Thread actions already solve the same problem with an
app-wide useData hook and a pure item that returns the evaluated action.
messageAction now takes experimental_useData, experimental_item and
experimental_selectionItem, plus experimental_placement ("inline" or
"menu") and experimental_order. An item returns null or
{ label, icon?, disabled?, run({ invokedFrom }) }; its input is the callback
context plus threadId, message, composer, requestEdit, canFork,
canSpawnChild and data, and the selection input adds { text, markdown }.
MessageActionCollectors runs each useData once for the threads whose
timelines are on screen. The run-only form keeps working where it always
showed. bb's five actions, Side chat, Conductor and ThreadChat's
experimental_messageActions (now ExperimentalThreadChatMessageAction) use
the item form.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A fork is a top-level thread, but creation ran the child-nesting depth check on its source, so a thread four levels deep could not be forked or side-chatted. Fork sources keep their missing, cross-project, archived and deleted checks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The item input drops threadId, canFork and canSpawnChild for thread, the timeline's thread as experimental_useThread reports it. experimental_useData takes no input and its collectors run app-wide. bb's Fork and Conductor's Fork to new workspace read experimental_useProviders through useData and check the thread's environment, archive state and provider fork support in item, so isThreadForkable and the hosts' canFork plumbing go away. Co-Authored-By: Claude Opus 5.5 <[email protected]>
experimental_useData now receives { threadId } and runs once per mounted
timeline instead of once for the whole app, so it runs only while that
thread's messages are on screen. ThreadTimelineRows mounts the collectors and
keeps their values in its own state, which replaces the app-wide store.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The item input drops thread; message.threadId is the timeline's thread. bb's Fork and Conductor read experimental_useThread and experimental_useProviders in useData and return only whether the thread can fork, so thread bookkeeping updates no longer re-derive every message's actions. The action bar resolves a row's actions from the timeline's useData values itself, so a new value re-renders the action bars, not the messages. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Add to chat tests become one table over role, text and attachments. The two fork-run tests become one sequence: a second click while a fork is pending does nothing, a rejected fork stays on the source and can be retried, and the retry opens the fork. The two ordering tests become one covering inline order and menu placement. The retired ThreadChat role tests merge, and a duplicate item test and a field-absence assertion go. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fork route gave every fork its source's section and pin, so a Side chat started from a pinned thread became a hidden thread that was pinned and sectioned with no way to see or unpin it. A hidden fork has no sidebar place, so it now gets neither; visible forks (bb's Fork, Conductor, bb thread fork) still do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
bb's Fork reads experimental_useProviders in its useData, and the core message actions load at boot. useProviders lived in plugin-sdk-hooks, so using it pulled that whole module and its imports (open-target hooks, the RPC query host, composer effects) into the boot payload: 32 KB raw and 8 KB brotli over main, past the budget. It moves to its own provider-directory-state module, whose only dependency is already in the boot payload. The boot payload is now 1 KB brotli over main, which is bb's message actions moving there from the thread page closure, which shrinks by about as much. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/message-actions-role-and-availability-filters-co-thr_zp3p6kd6tc
branch
from
December 1, 2026 05:43
18e8e6c to
dcbbcb8
Compare
A message action's run showed a check mark on its inline button when it resolved true, so the meaning of the return value lived only in a doc comment, an action returning some boolean got a check mark it never asked for, and it was the only plugin action whose run result drove UI. run now returns void like every other action and gets confirm(), which shows the check mark on an inline button and does nothing from a menu. bb's Copy calls it after a successful copy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Message actions sorted by experimental_order alone, with bb's raw order values in a doc comment, so a plugin had to copy bb's numbers to sit between its actions. They now sort by experimental_group, then experimental_order within it, then registration order with bb's own first: thread actions' rule. experimental_MESSAGE_ACTION_GROUPS exports bb's groups (copy, edit, compose, branch). The group is optional, unlike other slots, because slots.messageAction is stable and its run-only form predates groups; an ungrouped action sorts after every group, where unordered actions sorted before, so no action moves. Groups draw no separator. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The core message action registrations were collected into the plugin slot store at boot, which put them, Add to chat's quoting and the provider directory hook in the boot payload, though only timelines use them. The timeline's useSurfaceMessageActionSlots now puts them ahead of the plugin slots, so they load with the timeline code as bb's hand-wired actions did on main. The boot payload drops 0.6 KB brotli, back under its budget. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The message overflow menu was modal, so its focus trap pulled focus back from the composer that Add to chat had just focused, and focus fell to the body when the menu closed. Make it non-modal, as thread action menus are, so an action that moves focus keeps it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/message-actions-role-and-availability-filters-co-thr_zp3p6kd6tc
branch
December 1, 2026 18:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
slots.messageActionhad no way to say which messages an action works on, so every plugin action showed on every user and assistant message. Conductor's "Fork to new workspace" and Side chat's "Reply in side chat" showed on user messages, and Conductor's fork also showed on threads that cannot fork.ThreadChatProps.messageActionswas a second shape for the same thing, withrolesand arun(message)that got no thread, panel, composer or selection. bb's own Copy, Edit, Copy link, Add to chat and Fork could not have been built on the slot: they were hand-wired intoMessageActionBarandTimelineSelectionMenuwith their own role rules, availability, streaming state and placement. This closes audit finding a-thread F4 and core-contributions rank 10.What changed
Message actions now use the model thread actions already use: an optional
useDatahook per timeline, and a pureitemper message that returns the action or null. bb's five actions are ordinary registrations on that model, using only the public SDK.Slot contract (
packages/plugin-sdk/src/app-contract.ts, SDK 0.6.215):PluginMessageActionRegistration<Data>adds:experimental_useData?({ threadId }): Data. A React hook bb calls once per mounted timeline with that timeline's thread, never per message. Plugins read thread facts there withexperimental_useThreadand return only whatitemneeds.experimental_item?(input): pure and synchronous, called per message while rendering. Returns null or{ label, icon?, disabled?, run({ invokedFrom, confirm }) }.experimental_selectionItem?(input): the same for text selected in an assistant message. Its input addsselection: { text, markdown }.experimental_placement?: "inline" | "menu"(default"inline").experimental_group?: stringandexperimental_order?: number. The row, its overflow menu and the selection menu sort by group (string compare; unset sorts after every group), then order within the group (ascending; unset last), then registration order with bb's own first: the rule thread actions use withgroupandorder.experimental_MESSAGE_ACTION_GROUPSexports bb's groups:copy(Copy link 10, Copy 20),edit(Edit 10),compose(Add to chat 10, row menu and selection menu) andbranch(Fork 10). The group is optional, unlike other slots', becauseslots.messageActionis stable and its run-only form predates groups. Groups only order actions; the menus draw no separator.runreturnsvoidlike every other plugin action. Callingconfirm()shows a check mark on the inline button for 2 s; it does nothing from a menu. bb's Copy calls it after a successful copy.ExperimentalMessageActionItemInput<Data>) is the callback context plusmessage,requestEditanddata.composeris the composer of the message's thread on this surface.requestEditopens bb's inline sent-message editor and is null where bb would not offer Edit. There are no fork flags: a fork action computes its availability inuseData.{ id, title, icon?, experimental_surfaces?, run }) still works and shows where it always did. A registration mixingrunwithitemorselectionItemfails registration.experimental_appendQuoteToDraft(draft, text, attachments?)on@get-bb/plugin-sdk/app: bb's Add to chat quoting, pure, forcomposer.replace. Its implementation moved from client-core into the SDK's composer draft transforms. bb's message Add to chat, the diff, file-preview and terminal Add to chat, root compose's quote, the retiredcomposer.addQuoteand the test harness all run that one copy.ThreadChatMessageReferenceaddsexperimental_settled,experimental_attachments(ComposerAttachment[]) andexperimental_imageUrls.ExperimentalClipboardContentaddsimageUrl, copied through bb's own image clipboard writer.ThreadChatProps.experimental_messageActionstakes item-form registrations (withoutexperimental_surfacesorexperimental_useData) for one embedded chat.ThreadChatProps.messageActionsandThreadChatMessageActionare removed from the types, docs and test harness. Compiled plugins that still pass the prop keep working:PluginThreadChatadapts each entry into an inline item that returns null outside its roles, and warns once per plugin.Core on the shared path:
apps/app/src/core-contributions/message-actions.tsregisters Copy link, Copy, Edit, Add to chat (row menu), Add to chat (selection menu) and Fork throughdefinePluginApp, with public SDK imports only.composer.replace((d) => experimental_appendQuoteToDraft(d, text, attachments)), thencomposer.focus().useDatareadsexperimental_useThreadandexperimental_useProvidersand returns whether the thread has an environment, is not archived and its provider supports forking. Itsitemoffers Fork on assistant messages when that is true and the surface has a composer. Running it issdk.threads.fork({ sourceThreadId, sourceSeqEnd, origin: "app" })thennavigate.toThread, once per click, with bb's error toast on failure. It replacesuseForkThreadFromMessageand client-core'sisThreadForkable.MessageActionCollectors(apps/app/src/components/plugin/) runs each registration'suseDatafor the timeline.ThreadTimelineRowsholds the values and passes them through a context. Rows handMessageActionBartheir action source, and the bar resolves its own actions. So a newuseDatavalue re-renders the action bars, not the message content.lib/plugin-message-actions.tsbuildMessageActionsresolves items, placement and order for the row and the selection menu.MessageActionBarandTimelineSelectionMenurender only that list.TimelineSelectionMenukeeps itsonAddToChatpath for the diff, file-preview and terminal selection menus, which are not message actions.ConversationMessageContent,ThreadTimelineRows,ThreadTimelineSurface,ThreadScreen,ThreadDetailViewandPluginThreadChatdrop the per-action props and thecanFork/canSpawnChildplumbing.sdk.threads.forkputs the new thread in the app's cache before the caller navigates, as bb's button did. It imports the thread cache owner on demand to keep it out of the boot payload.useSurfaceMessageActionSlots(lib/message-action-surface.tsx) puts them ahead of the plugin slots instead of the plugin slot store collecting them at boot.experimental_useProvidersalso moves fromplugin-sdk-hooks.tsinto its ownprovider-directory-state.ts; importing it fromplugin-sdk-hooks.tshad pulled that whole module and its imports into the boot payload (32 KB raw over main).Server fork changes (every caller of
POST /api/v1/threads/fork):thread-fork.tsresolves the source's next-turn execution plan).bb thread forknow do too.canSpawnChild. But a fork has no parent, so it never deepens the tree. An agent at the limit can already create top-level threads withbb thread spawn. The check only stopped bb's Fork, Side chat and Conductor working in threads four levels deep. The other source checks (missing, other project, archived, deleted) stay.Queued-message edit: message actions get the composer of the message's own thread on that surface, including the inline editor of one of its queued messages while that is open. So during a queued-message edit, Add to chat quotes into that edit instead of the main draft. Before, it disappeared while the edit was open.
First-party callers:
itemandselectionItem. "Send to main thread" moves toexperimental_messageActions.item, with the same fork check as bb's Fork in its ownuseData. Itsrunreads the source thread withsdk.threads.get.engines.bbPluginSdkto>=0.6.215.Docs:
docs/api_to_audit.md: the message-action entry (contract, core and plugin callers, the fork and Add to chat paths, the retired prop, audit questions) and a newexperimental_appendQuoteToDraftentry.plugins/plugin-api-docs/src/surfaces.ts).frontend-renderer-slots.mdandfrontend-components.md.bb thread forkguide describes the model, section and pin a fork takes.Visible differences from main:
itemreturns an action for. Side chat and Conductor are assistant-only, and Conductor's fork is hidden where the thread cannot fork.focus-visibleopacity, because Copy is now an ordinary action button. No positions move.Community callers (not edited):
slots.messageActionin the run-only form: brsbl timeline-comments; vburojevic handoff and linear; rebryk bookmarks; and about 20 more in the corpus. All keep today's behavior.ThreadChatProps.messageActions: brsbl desktop, robdodson side-chat-links, xMinor-1 sticker-note, cristoslc focus-board and anirudhranganath thread-tabs. Their compiled code keeps working through the adapter and gets a one-time warning; rebuilding against SDK 0.6.215 needsexperimental_messageActions.How you verified
ThreadTimelineRows.actions.test.tsx:itemruns per message with that message's input; its action runs withinvokedFromandconfirm, andconfirm()turns the inline button into a check markuseDataruns once for the timeline with itsthreadId; items re-evaluate when its value changes, and it unsubscribes on unmountsdk.threads.forkonce at a time; a rejected fork stays on the source and can be retried, and the retry opens the forkexperimental_messageActionswith the full item input, and retiredmessageActionsfiltered by roleMessageActionBar.test.tsx: an inline run that confirms shows a check mark and ignores clicks meanwhile; the menu invocation and disabled rows. Both check-mark tests fail if the bar stops passingconfirm.MessageActionBar.test.tsx: a menu row whoserunfocuses another element keeps that focus after the menu closes; fails with the modal menu (focus ends on<body>).plugin-app-message-action.test.ts: defaults and validation for the item form.public-thread-fork.test.ts: a fork takes the source's picker model and reasoning over its last turn's. A visible fork takes the source's section and pin and a hidden fork takes neither; the hidden half fails on the previous route withexpected 'sec_…' to be null.thread-create-seed-without-run.test.ts: a thread at the nesting limit forks into a top-level thread.plugin-bound-sdk.test.ts: a plugin fork is in the thread cache before the caller navigates.PluginThreadChat.test.tsx: a retiredmessageActionslist still runs and warns once.ThreadTimelineRows.row-isolation.test.tsx) still sees each row render once on mount with per-timelineuseData.a6e31224a29:pnpm exec turbo run typecheck lint --filter='...[origin/main]': 167 of 167 tasks pass.public-thread-fork.test.tsandthread-create-seed-without-run.test.ts: 62 of 62 pass. Locally both files still fail at teardown on main's query-plan guard bug (below); with CI'sBB_QUERY_PLAN_EXECUTEDset they pass.5be1d105359),pnpm exec turbo run test --filter='...[origin/main]'passed apart from two causes unrelated to this branch:isThreadQueueAutoSendPaused(from Cache prepared statements for queue inspections #8367) trips the query-plan guard at file teardown in local runs only: the guard names the caller where the statement runs locally but where it is prepared in CI, and the allowlist namesprepareIsThreadQueueAutoSendPaused. A cleanorigin/maincheckout fails the same way. Every test in those files passes.install-machine-script, the Guide'splugin-authoring-docs, storage-retention, the provider-literal ratchet, host-daemoninjected-skills, 3 integration files) pass when re-run alone.pnpm start:worktreewith Codex turns and Side chat and Conductor installed:<body>.check-bundle-budget.mjson a local production build ofb6a39273c9d: boot payload 1667.4 KB raw / 418.5 KB brotli against main's 1665.1 / 417.8 ata6e31224a29(budget 1682.1 / 419.1). Against current main the boot payload grows only by this PR's registration validation (+2.7 KB raw), Add to chat's quoting with attachments (net +0.55 KB), the plugin fork's cache insert (+0.65 KB) and image copy (+0.1 KB).useDatabut re-rendered no rows. The branch's earlier design, which passed the thread in the item input, did 183 renders and 113 ms on a similar turn. I did not measure main.🤖 Generated with Claude Code