Optional notes on ask answers, and submittable empty multi-selects #228

Merged
lucas merged 1 commit from agent/issue-225-ask-notes into main 2026-11-06 11:48:23 +01:00
Collaborator

Closes: #225

What changed

Notes. ExtUiDialogResponse gains an optional note. Every select question in the ask dialog now renders a collapsed + Add note expander below the options; its text is sent alongside value/values (never instead of it, never as a cancel). The note is shown under the answer in the collapsed card, the Summary tab and the transcript tool card, and reaches the agent as an indented line beneath the answer line:

Pick one: selected: A
  note: one
  two

Enter inserts a newline in the note textarea (no submit-on-Enter), unlike the "Other" textarea whose text is the answer.

Empty multi-selects. deckSelect now returns a DeckSelectAnswer { values, note? } instead of a bare string[], so an empty values array is a real answer rather than falling through to undefined (which createDeckAskTool reads as X/Stop and aborts the turn). The dialog lets a multi: true question be submitted untouched — the button reads Submit (none selected) — and the agent receives <question>: none selected. Cancelling via X still aborts exactly as before and discards any typed note.

formatDetachedAnswer (dialogs restored after a server restart) also learned both: it previously dropped multi-select arrays and now renders notes too.

The generic select() / input() / editor() / confirm() extension methods are untouched.

Verification

  • bun test apps/server/src/bridge/ — 519 pass. New ext-ui-bridge.test.ts covers deckSelect parsing through the real frame/response path (empty selection, note kept, blank note dropped, no-selection non-answer, plain cancel, dismiss-for-new-message); deck-tools.test.ts covers formatAskAnswer([], undefined) === "none selected" and formatAskNote single/multi-line.
  • bun run typecheck — clean across all packages.
  • Throwaway script driving createDeckAskTool against a real ExtensionUIBridge with a single-select + note and an empty multi-select produced exactly the result text and details payload above.

The browser-side steps from the issue's verification list (manual cockpit walkthrough) were not run in this unattended session.

Closes: #225 ## What changed **Notes.** `ExtUiDialogResponse` gains an optional `note`. Every select question in the ask dialog now renders a collapsed `+ Add note` expander below the options; its text is sent alongside `value`/`values` (never instead of it, never as a cancel). The note is shown under the answer in the collapsed card, the Summary tab and the transcript tool card, and reaches the agent as an indented line beneath the answer line: ``` Pick one: selected: A note: one two ``` Enter inserts a newline in the note textarea (no submit-on-Enter), unlike the "Other" textarea whose text *is* the answer. **Empty multi-selects.** `deckSelect` now returns a `DeckSelectAnswer { values, note? }` instead of a bare `string[]`, so an empty `values` array is a real answer rather than falling through to `undefined` (which `createDeckAskTool` reads as X/Stop and aborts the turn). The dialog lets a `multi: true` question be submitted untouched — the button reads `Submit (none selected)` — and the agent receives `<question>: none selected`. Cancelling via X still aborts exactly as before and discards any typed note. `formatDetachedAnswer` (dialogs restored after a server restart) also learned both: it previously dropped multi-select arrays and now renders notes too. The generic `select()` / `input()` / `editor()` / `confirm()` extension methods are untouched. ## Verification - `bun test apps/server/src/bridge/` — 519 pass. New `ext-ui-bridge.test.ts` covers `deckSelect` parsing through the real frame/response path (empty selection, note kept, blank note dropped, no-selection non-answer, plain cancel, dismiss-for-new-message); `deck-tools.test.ts` covers `formatAskAnswer([], undefined) === "none selected"` and `formatAskNote` single/multi-line. - `bun run typecheck` — clean across all packages. - Throwaway script driving `createDeckAskTool` against a real `ExtensionUIBridge` with a single-select + note and an empty multi-select produced exactly the result text and details payload above. The browser-side steps from the issue's verification list (manual cockpit walkthrough) were not run in this unattended session.
The deck's ask dialog could only replace an answer ("Other") or cancel
it, so a caveat on an otherwise-fine option cost either the structured
answer or the whole ask result. Every select question now has a
collapsed "+ Add note" expander whose free text is sent alongside the
answer and surfaced in the review card, the summary tab and the
transcript tool card.

A multi-select answered with nothing checked used to be indistinguishable
from pressing X: the dialog refused to submit it and the bridge mapped an
empty selection to a cancel, aborting the turn. An empty selection is now
a real answer that reaches the agent as "none selected", while cancelling
keeps aborting as before.

Co-Authored-By: Claude Opus 5 via omp-deck
lucas approved these changes 2026-11-06 11:48:18 +01:00
lucas merged commit 6d2d7759ea into main 2026-11-06 11:48:23 +01:00
lucas deleted branch agent/issue-225-ask-notes 2026-11-06 11:48:24 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lucas/omp-deck!228
No description provided.