fix(ios): keep Chief attachments when trying a failed turn again

Merged
TE
7d ago
+125-11

Chief's Try Again rebuilt a failed input from text alone, dropping photos and files and substituting “Please try that again.” for attachment-only messages. It now resends the original text, image bytes and MIME type, files and file names, or an audio recording using the existing conversation APIs. Repeated taps send once. Missing original inputs or attachment bytes send nothing and keep the failure available for retry.

Leo's request:

well i just think we can improve it a f***ton more than it is now... it's slow it's bad it belabours the point in too many tooltips it's ugly in places it doesn't even work in places there's lots of functionality that needs to get in

This is the Chief portion of the retry fix. Failed agent Retry is handled separately by #27314 using the daemon's retry provenance. Edit and Resend remains separate; desktop edits fork before the edited turn. No shared CmuxConversation changes, menu removals, defaults, timers, or observers.

Validation:

  • Regression cases exercise the daemon send path for text, photos, files, attachment-only input, and repeated taps. Additional cases cover absent input, missing attachment bytes, and audio.
  • Static prepush checks passed at 66262e72f1e9402f25a329ea81a1a1dced35ccda. CI run 40835643733 passed macOS swift test and built/reran iOS simulator tests; the iOS step failed seven MacHomeFeedTests row-count waits plus TerminalSurfaceFramePacingTests. A focused same-head MacHomeFeedTests rerun is requested; those seven failures are not yet classified. TerminalSurfaceFramePacingTests failed identically in base run 40822120702.
  • Fleet request: base ba6bbf43e28b3d49f431d9438855650c90089347; head 66262e72f1e9402f25a329ea81a1a1dced35ccda; run ChiefEngineRecoveryTests and ChiefRetryMessageTests, plus the iOS package compile. Run the existing retry regression at 0817d9a8171 for red/green evidence.
  • Before/after dark and light screenshot scene: chief=-cmux-mobile-demo chief-open. Screenshots and fleet receipts pending.
  • Independent review pending coordinator dispatch; the local review launcher could not isolate its process scope.

Risk: retry uploads the original attachments again under a new outgoing message id. The original input remains intact if a complete resend cannot be constructed.

Agent session: agent session
🤖 Generated with Claude Code