Skip to content

feat(composer): stash a draft with Cmd/Ctrl+S and bring it back - #36727

Merged
bolichen97 merged 1 commit into
mainfrom
fix/14766-composer-prompt-stash
Nov 18, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/14766-composer-prompt-stash

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let a user park a half-written prompt with Cmd/Ctrl+S, ask something else in the same session, and bring the draft back with the same keys.

Today a user interrupted mid-prompt must send the unfinished text or cut it elsewhere, and cutting a collapsed paste leaves its [ Paste #N ] token without content. The Side chat (/btw) answers in a separate session, so the main agent never sees the question. The stash keeps the draft, in turn order and through a reload.

Builds on #14767 by @Pearcekieser.

Why it matters

Long prompts carry the most typing and are the ones most often interrupted by a quick question. Losing one, or the collapsed pastes inside it, to ask something small is a real cost.

Not a goal

  • A picker for several drafts. The chord restores the latest.
  • Stashing attachments. That ships in a follow-up PR.
  • Sharing a stash between sessions.

What changed (motivation → approach → change)

A half-written prompt can now wait while you ask something else in the same session: press Cmd/Ctrl+S in the message input and the draft is set aside; press it again in an empty input and the draft comes back. This is the feature from #14767, on current main.

Action Message input Result
Cmd/Ctrl+S or "+" menu has a draft saved with its paste blocks, input cleared, status line confirms
same stash holds 10 refused, draft kept, warning that names Discard
same stash at its 512 KB limit refused, draft kept; "Clear N drafts stashed in other sessions" asks once more ("Delete N stashed drafts for good") before deleting them
Cmd/Ctrl+S or "+" menu empty latest draft restored
Cmd/Ctrl+S empty, nothing stashed neutral note; the browser save dialog stays closed
"+" menu → Discard stashed draft any one draft deleted, Undo offered

Each draft is its own localStorage entry (mc-prompt-stash:<slot>:<id>) in utils/promptStash.ts: at most 10 per session and 512 KB overall, nothing evicted, every write read back before the input clears, all writes under one Web Lock. hooks/usePromptStash.ts holds the actions and copy; components/ChatInput.tsx and components/chat-input/ wire the chord, the menu rows (PromptStashBadge.tsx), the status line (PromptStashStatusLine.tsx) and an undo-history reseed (chat-core/composer/undoHistory.ts). On touch hosts where "+" cannot hold the rows they sit in the "⋯" overflow, which moves out of ChatInput into ComposerMoreMenu.tsx; ChatInput keeps no restyled primitive, so its row leaves website/scripts/restyle-baseline.json.

A restored draft keeps its entry until the server confirms the send, even after it is edited, sent and refused, or carried through a switch to another session and back. onSend/onSteer may return Promise<boolean>; components/useChatPaneSend.ts and ChatPage's send (pages/chat/page/composerSend.ts, a trailing reportConfirmed argument) say true only for a dispatched or queued receipt or a correlated echo, and the mid-turn steer (pages/chat/page/busyTurnControls.ts) resolves from steerMutation.mutateAsync. Permanently deleting a session (store/chat/lifecycle.ts, with stripDashboardSessionPrefixes from monitoring/automation.ts) clears its stash once the gateway answers ok: true. The side chat and crew windows pass promptStash={false}.

The chord is stash-prompt in lib/shortcutRegistry.ts, claimed only while the input has focus. Copy is in all 13 catalogs and pluralKeys.json; the feature is listed in docs/feature-map/README.md.

Backwards compatibility

Compatible: new i18n keys, new localStorage keys and a chord nothing used inside the message input; nothing existing is renamed or rejected. onSend/onSteer may return Promise<boolean>, a widening, and send's reportConfirmed is an optional last argument.

Removes nothing: the change adds a stash, menu rows and a shortcut row; every existing send, steer and delete path keeps its behaviour and return value for its current callers.

Tests

  • promptStash.test.ts: physical-key matcher, registry entry, per-entry keys, slot prefix isolation, no eviction across 80 sessions, corrupt entries, refused writes.
  • ChatInput.promptStash.test.tsx: stash and restore in both composers, paste blocks, remount, notes, failed write, Ctrl+Z, menu rows, attachments, cross-tab count, chord propagation, entry kept until delivery is confirmed (edited and resent after a refusal, or after a round trip through a session with its own draft), Discard and Undo, the overflow on a host without "+".
  • ChatInput.promptStashTouch.test.tsx, ChatInput.promptStashVoice.test.tsx: touch hosts' menus; no stash while dictation runs.
  • ChatPane.promptStashDelivery.test.tsx, ChatPage.sendResponseLate.test.tsx: refused, late or unconfirmed sends and steers keep the entry; a confirmed steer, or a send or steer echoed before its late receipt, removes it.
  • ChatSliceCoverage.promptStash.test.tsx, ChatSlicePromptStashDelete.test.tsx: delete clears only the deleted slot's stash, never a reopened slot's or a channel slot's.
  • CrewChatWindow.test.tsx: Ctrl+S writes no stash entry in a crew window.
  • monitoring/automation.test.ts: stripDashboardSessionPrefixes, the slot a history delete reads its stash owner from.
  • Updated for the new signatures: ChatPageDrafts, ChatPane.composerParity, busyTurnControls.steerFiles, busyTurnControls.steerSessionRefs (awaits the now-async steer()), dashboardSlice, ChatSliceCoverageSecondPass, ChatInput.collapse, ChatInput.inlineToolbarWhileFits.

Determinism: those 18 files (533 tests) passed 3 times in a row, then with --sequence.shuffle under seed 935775390.

Manual verification

Ubuntu Linux 24.04, Chromium from Playwright, an isolated gateway (KIROCREW_HOME in a fresh temp dir, a free loopback port, the fake ACP backend) serving the SPA built from this change.

Before (main): a two-line draft plus Ctrl+S left the draft in the input, showed no status line or count, and wrote no mc-prompt-stash: key.

After (smoke script, every check PASS):

PASS two-line draft typed
PASS Ctrl+S clears the input
PASS status line confirms the stash — "Stashed. Ctrl+S in an empty message input brings it back."
PASS an mc-prompt-stash:<slot>:<id> key exists
PASS after reload the count is still 1
PASS Ctrl+S in the empty input restores the draft
PASS browser save dialog never opens (every Ctrl+S default-prevented, no dialog/download)
PASS switch to session B in-app (sidebar row)
PASS switch back to A, restored draft is back in the input
PASS the count does not show the restored draft as stashed (its entry stays stored until delivery)
PASS send accepted (composer cleared, user bubble rendered, the fake backend answered)
PASS after delivery no mc-prompt-stash:<A>: key is left

The size limit was driven the same way: four drafts seeded under two other sessions, 524,224 of 524,288 code units, then a short draft refused with "Clear 4 drafts stashed in other sessions"; after the confirm all four keys were gone and the draft stayed in the input.

The chat and composer Playwright specs (chat, chat-form-switch-anchor, composer-mention-atomic-delete, composer-paste-highlight, composer-paste-highlight-scrollbar, new-session-draft-carry, optimize-cancel-mobile) ran against the same kind of gateway: 40 passed; 5 Soft-Stop and draft-carry cases failed on this branch and on a clean main checkout alike (a first-run notice intercepts the click).

Screenshots / video

Stash at its size limit: the draft is refused and kept, with Clear 4 drafts stashed in other sessions
One click later: the red Delete 4 stashed drafts for good confirm
After the confirm: other sessions' drafts deleted, the draft still in the input
Phone 390 px, the size-limit notice wraps with the Clear control
Desktop light, the size-limit notice
An attachment staged: Remove attachments to stash or restore
Desktop dark, draft stashed: status line and count
The "+" menu with the stash rows
Phone 390 px, the overflow menu with the stash rows

Every state

Before, on main: Ctrl+S leaves the draft and stashes nothing
Desktop light, draft stashed
Draft restored with Ctrl+S
Ctrl+S on an empty input with nothing stashed
Stash full: the 11th draft refused and kept
The "+" menu at the cap with Discard
Discarded, Undo offered
Keyboard shortcuts with the Ctrl+S row
Phone 390 px, draft stashed

Related Issues

Part of #14766

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 13, 2026 16:17
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)

GPT 6.1 flagged blocking issues on 632a9476bea367dbebc41d6b1d5da4ff5cb830ab; Opus 5.5 adjudication downgraded every one of them. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents.

This comment is updated in place on each push.

Review details

BLOCKING -- website/src/hooks/usePromptStash.ts:643 -- Preserve stash ownership through failed-steer recovery
if (draft.value === claim.draft.value && sameBlocks(draft.blocks, claim.draft.blocks)) pendingConsumeRef.current = claim
Trigger: Restore a draft containing a collapsed paste in ChatPage, steer it during a running turn, receive a refusal, then retry successfully. busyTurnControls.steer expands the paste into typedText and clears the blocks; turnActions.handBack restores that expanded text without the blocks. Neither this comparison nor the returned-claim effect recognizes the recovered draft, so the retry has no restore claim.
Outcome: The confirmed retry leaves the delivered prompt stored and counted as stashed. Cmd/Ctrl+S subsequently restores it again, and the stale entry continues consuming stash capacity.
Anchor: defect
Fix: Preserve the restore claim’s association through host recovery, either by restoring the original text and paste blocks or by explicitly associating the recovered draft with its claim rather than requiring byte-identical content.

[BLOCK-MERGE-DOWNGRADED] 632a947
[GPT-REVIEWED] 632a947

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 is low harm, so I'm downgrading it. The required chain is rare, and the result is visible and fixable by the user.

  • Conditions, confirmed in code: The draft must have been restored from the stash and contain a paste block. The steer then expands the paste tokens into typedTxt (website/src/pages/chat/page/busyTurnControls.ts:267,299). The steer must be refused, for example by a send race or a composer lock. handBack then puts back only the expanded text (turnActions.ts:180-185,194-203), so neither exact-match check finds the claim again (usePromptStash.ts:643, :335). Finally, the user must retry and the retry must succeed.

  • What happens: No data is lost. The delivered prompt simply stays in the stash, and the count shows it (usePromptStash.ts:646-647). The user can remove it with discardLatest (usePromptStash.ts:413).

  • Cost of the real fix: Paste blocks or the claim's identity would have to be carried through the steer and hand-back path across busyTurnControls, turnActions and the stash hook, which adds a new contract between modules for one rare path.

    [ADJUDICATION] 632a947 total=1 uphold=0 downgrade=1
    DOWNGRADE F1 website/src/hooks/usePromptStash.ts:643 reason=disproportionate-remedy
    [GPT-ADJUDICATED] 632a947

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 632a9476bea367dbebc41d6b1d5da4ff5cb830ab false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] note (non-blocking): what landing #14767's commit (3d60204) on current main took, beyond resolving the conflicts as unions. The feature, copy and keys are unchanged.

  • composerSend.ts: main gave send a sixth parameter, onUndelivered; reportConfirmed is the seventh, and the composer's two callers pass undefined for onUndelivered because the composer owns no failure report. busyTurnControls.ts's send option type matches.
  • busyTurnControls.ts: main's typedText/dictated steer fields, the /fork path and forkUnavailable are kept, with the PR's mutateAsync verdict threaded through.
  • attach.tsx / ChatInput.tsx: main's uploadSlot is kept beside the PR's stashMenuRows. lifecycle.ts keeps main's promoteSlot beside the PR's stashOwnerSlot.
  • File-line cap: ChatInput.tsx was 1,999 lines on main and 2,020 after the merge. The PR's own wiring moved into its own modules (PromptStashStatusRegion in PromptStashStatusLine.tsx, usePromptStashTrackedSends in chat-input/composerPromptStash.ts); it is now 1,981.
  • busyTurnControls.steerSessionRefs.test.ts: the second case wrapped the now-async steer() in a synchronous act, which left an act scope open and failed the other case under --sequence.shuffle; it now awaits, like the first case.
  • en-XA.json regenerated with npm run i18n:pseudo (identical to the merge result).

Size: 56 files, all from #14767's scope (PR Size limit 80).

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 632a9476bea367dbebc41d6b1d5da4ff5cb830ab — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: it fixes a real loss (an interrupted prompt and its collapsed pastes), the stash lives in the frontend only, the send verdict it needs is opt-in, and screenshots of this revision are attached.

Notes

  • send now takes seven positional arguments, the last three optional callbacks or flags (..., sendNow?, onUndelivered?, reportConfirmed?), and both composerSend and steer call it with long undefined/false runs. An options object would be safer before the next argument is added, but that refactor belongs in its own PR.
  • The steer path now reads its result from mutateAsync while other callers still use mutate. That leaves two ways to settle the same POST, and they can drift apart; keep the "confirmed" rule (dispatched or queued receipt, or a correlated echo) in one helper that both composerSend and steer call.

[DESIGN-REVIEWED] 632a947

Description read

[DESCRIPTION-READ] 3ac12d204468c4057199e07f56d9bb72b5b14b583fa494f4daa8014269b62458

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 632a9476bea367dbebc41d6b1d5da4ff5cb830ab — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The stash adds a new capability beside existing ones and changes no existing default. One mechanism goes further than the Goal needs.

Notes

  • Item 6 — oversized: a restored draft "keeps its entry until the server confirms the send", which widens onSend/onSteer to Promise<boolean> and adds reportConfirmed to send. But restoreSentTurn (pages/chat/page/composerSend.ts:216) already puts a refused send back in the composer, and the draft store saves that copy. Subtraction: delete the stash entry when it is restored, and drop the Promise<boolean> widening, reportConfirmed, usePromptStashTrackedSends and the steer mutateAsync change. Clears when: the mechanism is removed, or a human amends the Goal.

What this change ships

Inventory (8 items) — 6 justified

Intent: let a user set a half-written prompt aside, ask something else in the same session, then bring the draft back. ADDITION.

  1. Cmd/Ctrl+S in the composer stashes a draft, or restores one when the input is empty — justified
  2. "+" menu rows: Stash, Restore, Discard with Undo — justified
  3. A status line above the buttons shows the stash count and notices — justified
  4. Ctrl+S inside the composer no longer opens the browser's save dialog — justified
  5. On a touch host without a "+" menu, a "⋯" overflow now appears to hold the stash rows — justified
  6. A restored draft stays stored until the server confirms the send — oversized
  7. Past the 512 KB limit, a two-step "Clear N drafts stashed in other sessions" delete — undeclared
  8. Permanently deleting a session also clears its stash — justified

[FIRST-PRINCIPLES-REVIEWED] 632a947

Description read

[DESCRIPTION-READ] fba920c1c98d0f349d3a4237ad369c167e2d097947e5209c690a673c230de45f

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 632a9476bea367dbebc41d6b1d5da4ff5cb830ab — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The main path is Ctrl+S, the Stash, Restore and Discard menu rows, and Undo. All of it appears in the screenshots, and the blind reader understood every step and would use it. The only confusion is on the rare size-limit recovery path.

Notes

  • too_large ends with "Discard a stashed draft to make room", but the only action offered is "Clear 4 drafts stashed in other sessions". The reader would not click it ("I can't see what those 4 drafts are"). Change the ending to name that action, e.g. "Clear drafts stashed in other sessions to make room."
  • clear_others_confirm drops the scope: "Delete 4 stashed drafts for good" left the reader unsure it still meant only other sessions. Use "Delete 4 drafts from other sessions for good."
  • cleared_others ends "Stash this one again." with no way to do it. Add the chord (desktop) or the menu glyph (touch), as notice_stashed already does.

[UX-REVIEWED] 632a947

Description read

[DESCRIPTION-READ] c977152cf74f1120e1611dbcf6feaabc451de2b185a2685fce7d86ba87a07507

That sha256 names everything this verdict read: the PR description, plus the 21 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@bolichen97
bolichen97 enabled auto-merge (squash) November 13, 2026 16:21
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 632a9476bea367dbebc41d6b1d5da4ff5cb830ab — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 632a947

Verdict parsed from the review's SHA-scoped output markers for commit 632a9476bea367dbebc41d6b1d5da4ff5cb830ab.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 632a9476bea367dbebc41d6b1d5da4ff5cb830ab false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 13, 2026
Cmd/Ctrl+S in the composer moves the current draft (text plus the paste
blocks behind its tokens) onto a per-session stash and clears the
composer; the same chord on an empty composer restores the latest entry.
The stash persists in localStorage per chat slot, holds up to 10 drafts
and refuses a further stash at the cap instead of dropping one. A count
badge sits beside the mic button and a polite live region reports each
action. The chord is claimed only inside the composer, so the browser's
save dialog and document-level save handlers never see it there.
@bolichen97
bolichen97 force-pushed the fix/14766-composer-prompt-stash branch from 042eca6 to 632a947 Compare November 17, 2026 21:42
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto current main to resolve the merge conflict in website/src/i18n/pluralKeys.json.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 17, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: the pane's delivery verdict also counts a correlated echo of the same send

  • span=788586f5dc4d Confirmed pane echoes leave delivered drafts stashed

fixed in 632a947: doSend and doSteer in useChatPaneSend.ts return true for a dispatched or queued receipt OR selectSendConfirmed(store.getState(), slotKey, sendId), the same verdict ChatPage's send and steer use, so a response-late receipt after a matching echo removes the restored draft's entry.
Tests: ChatPane.promptStashDelivery "removes the entry when the send is echoed before its receipt comes back late" and its mid-turn steer twin, red with the fix reverted and green with it.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: a restore claim carries the draft the composer last held for it

  • span=de7b852e75fc Edited drafts lose their stash association after a refused send

fixed in 632a947: a restore claim in usePromptStash.ts carries draft, which follows edits while the claim is pending and is snapshotted by trackSend at submit time; a refused send's recovery and the returned-claim effect re-arm against that draft, so an edited restored draft that is resent with confirmed delivery removes its original entry and a re-stash replaces it instead of adding a copy.
Tests: ChatInput.promptStash, both "retry me, edited" orders (host restores before and after the verdict) plus the "after an edit" session round trip, red with the fix reverted and green with it.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: the returned-claim effect keeps the claim while the composer still shows the draft seen at the session switch

  • span=29fc3cd54fe5 returned restore claim dropped on the session-switch commit

fixed in 632a947: usePromptStash.ts records the draft on the commit that changes sessions (switchDraftRef) and the returned-claim effect only drops a claim once the composer has changed after it, so when the host puts session A's own draft back a commit later the claim re-arms and the confirmed send removes the entry.
Test: ChatInput.promptStash "removes a restored entry after a round trip through a session with its own draft, put back after the switch", red with the fix reverted and green with it; also driven on the real product (switch A to B with its own draft and back, send, no key left).
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: a returned restore claim re-arms only when the composer holds the draft it left with

  • span=de7b852e75fc Preserve stash ownership through failed-steer recovery

Rebutted (disproportionate; not data loss): the chain needs a stashed draft holding a collapsed paste, restored, steered mid-turn, refused by a send race or composer lock, then retried with success.
The outcome is extra retention only: the delivered prompt stays stashed, counted on the badge, and "Discard stashed draft" removes it; no text is lost, sent twice or shown to anyone else.
Matching the handed-back text would need the claim's identity carried through busyTurnControls' steer and turnActions' handBack, a new contract across three modules for one rare path; this lane's adjudication downgraded it as disproportionate-remedy.
[operator: bolichen97]

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 18, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. On this head the review traced every path that deletes a stash entry. It also checked that the send and steer verdicts (confirmed, refused, late and echoed receipts) leave a restored draft stashed until delivery is confirmed, and that the history-delete cleanup clears keys only on an ok: true answer and skips aliases and channel slots. It checked the blocking frontend rules too (ErrorNotice, lucide icons with labels, two buttons per row, ratchet only tightening, deterministic tests), and found nothing that breaks.
Done well: the store refuses at its count and byte limits instead of evicting, and it reads every write back before the composer clears, so no draft is lost silently.
Optional:

  • Add a SideChat test like the new CrewChatWindow one. Today, removing promptStash={false} at SideChat.tsx:1142 turns no test red, and off-record text would then land in the main session's stash.
  • Keeping the entry until delivery is confirmed brings in most of the claim machinery in usePromptStash.ts and the Promise<boolean> widening of onSend/onSteer. Deleting the entry on restore would still meet the Goal, so consider that in a follow-up.
  • The commit body still describes a count badge beside the mic button. The feature-map row leaves out the crew-window opt-out and the Discard row. When this lands, close #14767 as superseded.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 20% chance that this change introduces a defect, above the 12% limit for approving on its own.

This PR adds a per-session prompt stash on Cmd/Ctrl+S: a draft is set aside with its paste blocks and brought back later. Drafts are kept in localStorage, capped at 10 per session and 512 KB overall, with no eviction. The send and steer verdicts were verified on every host. They return true only for dispatched/queued receipts or a matching echo, which are the only accepted results sendTurn produces. Hosts with no verdict keep the entry, and the crew window and side chat opt out. Deleting a session clears its stash only after the gateway answers ok:true, which matches the backend's {"ok": ok} reply. The overflow-menu refactor keeps the same mount conditions on the existing hosts, and the mutate→mutateAsync switch keeps the same success/error handling. Tests are extensive and CI is green. The one confirmed gap (a steer refused and then retried with a paste leaves a delivered draft stashed) is rare, visible and loses nothing, so it is a note, not a blocker.

Tier: 2, held for a person: design-doc-gate: D.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 632a9476be · 5214 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@bolichen97
bolichen97 merged commit 7dcb71e into main Nov 18, 2026
98 of 99 checks passed
@bolichen97
bolichen97 deleted the fix/14766-composer-prompt-stash branch November 18, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants