feat(plugins): composer actions can need a draft and insert their result (#201898)
## What Problem This Solves
A composer action that rewrites the draft, like Better, has two rough edges with the task card from #201695:
- It can be clicked with an empty composer, though it only works on text the user typed. The SDK gave `resolve` no way to see the draft.
- Its result always waits behind **Use**. For an action whose result the user asked for and nearly always takes, that extra step is friction: they already pressed the button.
## User Impact
- A composer action's `resolve` receives the pane's current `draft`, and the host re-resolves as the user types. An action can return `{ disabled: !draft.trim() }` and stay disabled until there is text, like the send button.
- `task.propose(text, { title, insert: true })` (and `composer.propose`) replaces the draft at once: the same single editor undo step and **Draft replaced · not sent · Undo** receipt as **Use**, never sent. While dictation or a pending goal locks the editor, or during IME composition, it falls back to the proposal card so **Use** writes it once the editor is writable.
Both are optional and additive; existing actions behave as before.
## Why This Change Was Made
- **One owner:** the pane's task owner does the insert through the same path as **Use** (`apply`: settle as accepted, one editor replacement, receipt). It reads the editor through an accessor that returns nothing mid-composition, so the lock rule stays the same as **Use**.
- **Resolve sees the draft where it already runs:** the contributions renderer reads the handle's reactive `draft`, so a disabled state follows typing without a new subscription; the runner passes the same draft to `resolve` before running, so a stale click on a disabled action is refused.
## Evidence
- **New e2e** in `ui/src/e2e/native-plugin-composer.e2e.test.ts`: an icon action with `resolve: ({ draft }) => ({ disabled: !draft?.trim() })` is disabled on an empty composer and enabled after typing; its `insert: true` result replaces the draft with no proposal card, resolves `"accepted"`, Undo restores the draft, zero `chat.send`. All 10 composer-task e2e tests and the unit tests pass.
- `tsgo:ui`, `tsgo:core`, oxlint, oxfmt, `check:control-ui-controllers`, line-cap and test-lines ratchets.
- Real run with a real model on a source Gateway from this branch with the Better plugin: screenshots in the comments.
- Chat boot JS is unchanged against main (the task owner reads the pane state itself, so no new wiring loads with a chat).
**SDK impact.** Additive: optional `draft` in a composer action's `resolve` context, optional `insert` on `ControlUiDraftProposal`. `ControlUiAction` has no ClawHub or bundled consumers besides Better (checked for #201695).
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Current
·
C2
·2026-11
feat(plugins): composer actions can need a draft and insert their res…
Find Your Interest
- Attack Technique: AI Clones
- Dan Maher from Datadog Says AI Agent Reliability Is an Engineering Problem, Not a Model Choice
- Plugins to build an accessible form for WordPress
- This Week In Security: Four-Digit Patch Tuesday, SSH Exploited, GitBook Breach, Android GhostMap
- Disney picks Adobe as its new AI and price-hike partner
- This Week’s Awesome Tech Stories From Around the Web (Through November 7)
- A Neural Net For a Graphing Calculator?
- F1 drivers go small as Lego puts entire grid in plastic
- I Expected A Faster i4 M60. Instead, The 838 hp Electric BMW M3 Drives Like A Real M3 On Track
- This Week’s Weird and Wonderful—November 13, 2026
Current
·
C2
·2026-11





