Repository navigation
feat(desktop): hold a send through a running compaction instead of handing it to the queue - #1696
Merged
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Verification
Local self-test on this machine (Node v26.3.0,
ulimit -n 8192):npx tsc --noEmit→ cleannpx 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→ cleannpx vitest run(whole desktop suite) → 442 files / 6296 tests passedUser-visible changes
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.