Repository navigation
Description
The workflow
A plugin wants to put text into the composer draft of a specific, already-open thread — append, not send — so the user can edit before sending. Motivating case (#6166, second prototype): "Reply in open side chat" appends a quoted review selection to the composer of the side chat the user already has open. The draft is the point of the UX: the user refines the quote plus their question, then sends manually.
What happens today
There is no SDK way to reach the draft of a thread by id:
PluginComposerApihandles are only obtainable for composers the plugin can currently see mounted:useComposer()in its own surfaces,useComposers()— "every composer on screen" (app-contract.ts#L5624) — andmessageAction'scomposer, which is "the composer of the thread the message is in" (app-contract.ts#L3464-L3468). None targets an arbitrary thread id, hooks cannot be called from aruncallback, and a backgrounded panel's composer is not mounted, so it is not in the list at all.sdk.threadsofferssendand queued messages — that delivers a sent/queued message, a different UX than an editable draft.ThreadChatPropshasfocusRequestbut no draft seed/append prop (app-contract.ts#L4698).- Meanwhile core's prompt-draft store is already keyed by project id + thread id (usePromptDraftStorage.ts#L228) and mounted composers subscribe to it. The primitive exists in core; it is just not reachable from the SDK.
What you would expect
An SDK call that appends to (or seeds) a thread's composer draft by id, writing through the existing prompt-draft store:
sdk.threads.experimental_appendToComposerDraft(threadId: string, text: string): Promise<void>A mounted composer picks the change up live through its existing store subscription; an unmounted one shows the appended draft the next time it mounts. (A declarative draft-seed prop on ThreadChat was considered as an alternative shape, but the imperative form also works when the target composer is mounted elsewhere or not mounted at all, which is the motivating case.)
Acceptance criteria:
- Appending to a thread whose composer is mounted updates the visible draft live, preserving the existing draft content with the same separator behavior core quoting uses.
- Appending to a thread whose composer is not mounted persists the draft; the composer shows it on next mount.
- No send or queue side effects; the user edits and sends manually.
- Per AGENTS.md, the new SDK member ships
experimental_-prefixed with adocs/api_to_audit.mdentry, and is listed inplugins/plugin-api-docs/src/surfaces.tswith a Plugin Guide example. - Tests: draft-store round-trip by thread id, live update of a mounted composer, and the unmounted-then-mounted path.
Context and alternatives
- Companion to Plugin API: selection-action slot for the diff and file-preview selection menus #7013 (selection-action slot for diff/file-preview). Together they make "Reply in open side chat" (Add "Reply in side chat" to code-review (git-diff) selections #6166) implementable as a pure plugin: the selection-action slot provides the entry point in the review menu, this API delivers the quote into the open side chat's draft. The core-side mechanics (shared draft-store append with live pickup in the mounted side chat, plus target resolution) are prototyped and verified on a working build: https://github.com/kolsha/bb/tree/feat/git-diff-reply-in-side-chat
- Ruled out:
useComposers()(mounted-only, and a hook — unusable from action callbacks);messageAction.composer(bound to the message's thread, not the target side chat);sdk.threads.send/queue (sends instead of drafting);ThreadChat.focusRequest(focus only). - All code references are at main
d060de8e30f3310417054a74510a774dd2909e2b.
Checks
- I searched open and closed issues for the same request (closest: Add "Reply in side chat" to code-review (git-diff) selections #6166 — the motivating feature; Plugin API: move the existing composer into a sidebar tab #6263 — moving a mounted composer, not drafting by thread id; 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 — new-thread composer seeding, not an existing thread's draft).
- If an agent wrote this, the body ends with
> AGENT GENERATED.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 4, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied and verified the previously missing classification:
plugins,uiNo existing classifications needed preservation. No reproduction report or pull request: this requests new SDK functionality, not a bug fix.