Repository navigation
fix(mobile): heal terminal input after ambiguous image-send delivery - #10325
Conversation
An image send whose text+Enter RPC ended 'unknown' (ack loss / path cutover) collapsed to accepted=true, so the terminal was never marked stale. When the Enter truly never landed, the already-pasted image path sat on the input line and glued onto the next plain-text message. Propagate the send outcome through handleNativeChatSendWithOutcome and mark the terminal input stale on any non-accepted outcome; the next send heals with Ctrl+U (a no-op when the message did land). Chips still clear on 'unknown' to avoid a double-send on retry.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughNative chat sends now expose accepted, rejected, and unknown outcomes. The existing boolean send method converts these outcomes for compatibility, while image-attachment hooks preserve outcome details to manage stale markers and attachment chips. The session screen uses the new outcome-preserving method. Tests update send mocks to status tokens and cover ambiguous image delivery healing and text-only behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…tablyai#10325) An image send whose text+Enter RPC ended 'unknown' (ack loss / path cutover) collapsed to accepted=true, so the terminal was never marked stale. When the Enter truly never landed, the already-pasted image path sat on the input line and glued onto the next plain-text message. Propagate the send outcome through handleNativeChatSendWithOutcome and mark the terminal input stale on any non-accepted outcome; the next send heals with Ctrl+U (a no-op when the message did land). Chips still clear on 'unknown' to avoid a double-send on retry.
Summary
'unknown': ack loss / relay-direct cutover / request timeout) but truly never landed, the already-pasted image path stayed on the terminal input line and silently glued onto the next plain-text message.handleNativeChatSendcollapsed'unknown'toaccepted=true, so the image hook'smarkTerminalInputStaleonly ran on hard reject — the ambiguous subcase never armed the healing Ctrl+U.handleNativeChatSendWithOutcome(outcome-preserving surface; boolean wrapper keeps existing callers unchanged) and wire the image-attachments hook to it. Any non-acceptedoutcome after a successful paste now marks that terminal's input stale, so the next send leads with the healing Ctrl+U — a no-op when the message actually landed. Chips still clear on'unknown'(the send usually did land; a kept chip would double-send on retry), and the unconfirmed-delivery toast still shows.Testing
'unknown'on the WithOutcome surface.terminal.sendframe pre-wire in the app's Hermes runtime, letting the app's own 30s timeout mark delivery-unknown. The image paste landed (desktop claude input showed the orphaned[Image #1], message not submitted); the follow-up plain-text send healed the input and arrived clean — claude answered "no-image". Before this fix the orphan rode onto that later message.Orphaned image on desktop input after the ambiguous send (paste landed, Enter lost):

Follow-up message arrives clean on both sides (healing Ctrl+U preceded it):


Notes
'rejected'behavior is unchanged (stale marker + kept chips + "Message not sent").'unknown'— nothing was pasted first.