Repository navigation
fix(mobile): keep standalone compaction out of the reply stream - #721
Merged
Merged
Conversation
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.
Two reports from the phone: a compaction tap that seemed to do nothing, and a screenshot showing a committed compaction divider with the composer stuck on "generating" and the send button replaced by stop.
Root causes
agent_endas "the run is active". So a manual compaction re-opened the settled reply, set the session to streaming, and, because noagent_endfollows, never cleared it: the phantom "generating…" bubble plus the stop button in the report.pendingflag and returned without a word when it was set. A missed terminal frame (backgrounded app, dropped stream) left that flag set for the whole 30-minute timeout, during which every tap of a visible action did nothing./query, so/压缩stayed in the input to be sent as a message.Changes
phase, ascompaction_started/committedcarry) becomes its own divider item, so it never revives a finished reply; a mid-turn compaction stays inline in the run it belongs to, keeping the shared projector's "interrupted before completion" marking intact. A standalone compaction that produces no marker (nothing to compact / reused result) takes its own running placeholder away instead of leaving an empty bubble.unobserved, no invented result) rather than by a 30-minute timeout./action runs through the completion hook again, so the typed command is removed from the draft.cdp.mjs: anevalstep that throws now fails the capture run. Previously it only printed, so assertion-styleevalsteps (already used by several scenarios) could never fail — which is how the draft bug above shipped as "verified".Verification
tsc --noEmit, eslint,jest --runInBand(1644 passed) — new tests cover the standalone/mid-turn routing, the no-marker case, the lost-terminal settle, the refused tap, and that running an action clears the draft.?compacted=1): with this fix1/1 captured; reverting onlyprojection.tsfails the same scenario withcommitted compaction left the reply generating(0/1). The three compaction scenarios (compact-context,compacting,compact-context-outcome) pass, and the committed screenshot shows the divider with the normal send button and no "generating" text.