Repository navigation
feat(ios): steer queued chat messages into the running reply - #187078
jorge-monalee wants to merge 1 commit into
Conversation
Queue next messages now wait on the device while the visible reply runs, as Control UI queued messages do, and can be steered from the message menu or with Command-Return on a hardware keyboard. Steering reuses chat.send with queueMode steer.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR holds explicit Queue next messages locally and adds menu and hardware-keyboard actions to steer them into an active reply. Example: While an iPhone reply runs, queue “Use metric units,” then choose Steer from that message’s menu.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain This PR offers a distinct native-chat capability, but introduces a same-session ordering regression and needs an owner decision on device-held delivery. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe shared Apple chat composer feeds a gateway-scoped SQLite outbox; the view model claims durable messages and sends them through existing route leases to Gateway chat.send. flowchart LR
Composer[Apple chat composer] --> Model[Chat view model]
Menu[Message Steer action] --> Model
Model --> Store[SQLite outbox]
Store --> Lease[Existing route lease]
Lease --> Gateway[Gateway chat.send]
Gateway --> Reply[Active reply or followup]
Technical reviewBest possible solution: Preserve same-session FIFO in the existing outbox and agree on whether Queue next may wait for the app to become active. Do we have a high-confidence way to reproduce the issue? Source establishes the failure: with effective queue mode collect, enqueue A through Queue next and then B through ordinary Send; A is filtered out while B’s nil-mode row remains claimable. No target code was executed. Is this the best way to solve the issue? Reusing the existing durable outbox is a focused implementation, but its scheduling policy must preserve ordinary same-session ordering rather than treating every non-followup row as an intentional bypass. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 700930378c79. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +140, Tests +106, Docs 0. Total +246 across 12 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 28, 2026, 7:33 PM ET / 23:33 UTC. |
|
Closing this in favor of keeping Queue next in the Gateway queue. Holding messages on the device delays delivery while the app is inactive, and it caused the ordering bug ClawSweeper found. Steering a queued message from iOS should use the |
Related: #168604
What Problem This Solves
Fixes: on iPhone, a message sent with Queue next while a reply is running goes straight into the Gateway's queue, so it can't be steered into that reply the way Control UI's queued messages can.
User Impact
User impact: while a reply runs, a Queue next message stays in the chat as Queued. Touch and hold it and choose Steer to send it into the running reply now, or press Command-Return with an empty draft on a hardware keyboard to steer the oldest queued message (Command-Return with a typed draft sends it). If you do nothing, queued messages send in order when the reply finishes.
Behavior change to note: Queue next messages now wait on the device instead of in the Gateway queue. If the app is closed or backgrounded before the reply finishes, they send the next time the app is active. Switching to another chat, or a run this view can't see, hands them to the Gateway queue as before. Tapping Send and Steer now are unchanged. The macOS app shares this chat code, so it gets the same hold and the Steer menu item, but not the shortcut. Easy to revert (two-way door): no schema change, no new Gateway request, and rows already queued keep working either way.
Why This Change Was Made
Control UI holds queued messages on the client until the run is idle and steers one by re-sending it with
chat.sendqueueMode: "steer". The iOS durable outbox now does the same, reusing the existingqueue_modecolumn andchat.sendrequest:Steering a message the Gateway has already queued still isn't possible from iOS; #160275 / #160593 propose a
chat.steerrequest for that.Evidence
ChatViewModelBusySendTests›queue next waits for the visible reply then keeps FIFO(replaces the old busy-followup FIFO test, which expected Queue next to go to the Gateway right away): the row stays queued and steerable during the run, then sends asfollowup, in order, once the run settles.ChatViewModelBusySendTests›steering a queued message sends it into the running reply ahead of older queued messages: the menu path sends the newer row assteerwhile the older one stays queued, then the keyboard path steers the older one.ChatCommandOutboxStoreTests›held queue next rows let later rows pass and steer only while queued: claim skips only the held session's followups, and the steer update is refused once a row has been claimed.ChatComposerTextViewIOSTests›command return routes to send or steer outside text composition: Command-Return/Enter route to the handler, other modifiers and IME composition don't, and an unhandled key falls back to UIKit.--lint --config config/swiftformaton the 10 changed Swift files: 0 need formatting. Changed Swift lines stay within the 120-column limit.pnpm native:i18n:verify: pass (one new source entry,Steer; translations are left to the locale refresh workflow). Docs:oxfmt --checkanddocs:check-mdxpass, no spellcheck hits indocs/platforms/ios.md, andgit diff --checkis clean.2882b90, source-sha2564cf7f15a…), branch mode, basedadf9122058, head594e4ae5cb6, P0–P2, Claude engine (Codex CLI isn't logged in on any host available to me). Result: scoped-clean, no findings. I checked the three things the reviewer couldn't confirm: every input to run activity is observation-tracked (liveRunStateByRunIDregisters access and mutation by hand), a session switch resets all of them so held rows get released, and the only outbox conformers are the SQLite store and the test double.@discardableResult. The change is +255/−9 against the merge base: about 150 production lines (no new types, no migration) and 112 test lines.