Repository navigation
feat(mobile): hold a send through a running compaction instead of refusing it - #1679
Merged
Merged
Conversation
…using it A manual compaction owns the session for as long as the summary takes — minutes on a long conversation — and the Agent refuses prompts meanwhile (`session_busy`, `busy_reason: compaction`). The phone disabled the send button for that whole window, so a message written during a compaction could not be handed over at all. The tap is taken now instead of dropped: the button stays live, the draft stays in the field, `useComposerSubmission` waits for the fence to open and sends the words the reader tapped with (a draft edited meanwhile is not sent; leaving the screen ends the wait without delivering). While the tap waits, the send button reads busy and the composer says "Sending when compaction finishes…". The send path itself still refuses a prompt mid-compaction, so the wait is the only new behaviour.
huichen
enabled auto-merge (squash)
November 24, 2026 01:22
huichen
added a commit
that referenced
this pull request
Nov 25, 2026
…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
added a commit
that referenced
this pull request
Nov 25, 2026
…nding it to the queue (#1696) 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.
The mobile composer used to disable Send for the whole of a manual context compaction, so a message written while the summary was being produced could not be handed over at all. It now takes the tap and holds it: the button stays live, the draft stays in the field, and the send leaves the moment the Agent closes the compaction fence.
Commits
feat(mobile): hold a send through a running compaction instead of refusing it— the composer keeps Send enabled during a compaction,useComposerSubmissionwaits for the fence to open and delivers the words the reader tapped with; a draft edited meanwhile is not sent, leaving the screen ends the wait without delivering, and the composer shows "Sending when compaction finishes…" while the tap is held.Verification
Run in
mobile/ondev-huichen@8021fd1ad:npx tsc --noEmit— passednpx eslint .— passednpx jest --runInBand— 174 suites / 3324 tests passed (includes the two new composer tests)mobile/node_moduleswas missing@react-native/[email protected](pinned bypackage-lock.json); it was unpacked locally to run the suite. No tracked file or lockfile changed.User-visible changes
Mobile chat composer during a manual context compaction:
chat.sendAfterCompaction(en / zh).c453c3eb1.Notes
None.