Skip to content

feat(desktop): hold a send through a running compaction instead of handing it to the queue - #1696

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Nov 25, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

Desktop: pressing send while a manual compaction is running no longer hides the message in the Agent's queue. The click is taken instead — the draft stays in the composer, the send control reads busy, the control row shows Sending when compaction finishes…, and the words present at click time go out when the compaction ends. This mirrors the phone behaviour (#1679) and replaces the desktop's previous silent queue hand-off (#1680), where the draft vanished from the box and nothing visibly happened.

A held send is abandoned and the draft kept in four cases: the draft is edited during the wait (text, attachments or the choice card's answer), the conversation is switched, a run takes the session in the meantime, or the window closes. Because the wait is local component state, a held message dies with the window — intended for this surface.

The send path is otherwise untouched: compaction is still not a reason to disable the button, and no Agent-side compaction or queue semantics change.

Commits

  • feat(desktop): hold a send through a running compaction instead of handing it to the queue

Verification

Local self-test on this machine (Node v26.3.0, ulimit -n 8192):

  • npx tsc --noEmit → clean
  • npx eslint src/features/agent/Composer.tsx src/features/agent/composer/ComposerControls.tsx src/features/agent/Composer.compaction.test.tsx src/features/agent/Composer.delivery.test.tsx → clean
  • npx vitest run (whole desktop suite) → 442 files / 6296 tests passed

User-visible changes

  • Desktop, manual compaction + send: before, the draft disappeared from the composer and the prompt silently ran later from the Agent queue; after, the draft stays in the box, the send control reads busy, the row says Sending when compaction finishes… (localized), and the message goes out when the compaction ends. A held send is dropped (draft kept) if the draft is edited, the thread is switched, another run takes the session, or the window closes. Rollback: revert 76133b3.

…nding it to the queue

A manual compaction owns the session for as long as the summary takes — minutes
on a long conversation. The Agent takes a prompt written meanwhile and runs it
when the fence opens (#1680), but that leaves the message in a queue this window
says nothing about: the draft vanished from the box and nothing arrived, which
reads as "my message disappeared".

Take the click instead, the way the phone already does (#1679): the draft stays
in the box, the send control reads busy, the control row says 压缩完成后发送…,
and the words that were there when the button was pressed go out when the
compaction ends. Four endings are not a send and all keep the draft — edited
during the wait (text, attachments or the card's answer), switched conversation,
a run taking the session meanwhile, or the window closing. The wait is local
state, not the Agent's queue: a held message dies with the window, which is the
behaviour the user picked for this surface.

The send path itself is untouched: compaction still is not a reason to disable
the button, and nothing about the Agent's compaction or queue semantics changes.

Verified: tsc --noEmit, eslint, and the whole desktop suite (442 files / 6296
tests) green; the new `Composer.compaction.test.tsx` fails outright with the
hold removed and separately with the "edited meanwhile" comparison removed.
Captured against the demo data in headless Chrome: the same click before (draft
gone, message queued silently) and after (draft kept, control busy, hint shown).
@huichen
huichen enabled auto-merge (squash) November 25, 2026 15:19
@huichen
huichen merged commit f672c2d into main Nov 25, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch November 25, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant