Send local TUI images as portable attachments to remote app servers (#45499)

## Why

Remote app servers cannot read image paths on the TUI host. Image attachments need to carry their contents when submitting to a remote workspace.

## What changed

- Prepare local images as data URLs off the event loop for new turns and steers, preserving source pixels for model-specific resizing and enforcing a 32 MiB image transport budget.
- Show preparation progress, preserve queued message order, and recover drafts on preparation failures, cancellation, disconnects, or thread switches. Ignore stale preparation completions.
- Avoid duplicate user messages from server receipts and duplicate image labels in history.

## Testing

Add regression tests for portable image contents, receipt deduplication, draft restoration, responsive input during preparation, and cancellation across thread and connection changes.

GitOrigin-RevId: 6404615eae0b06c141af96b4229501c61f7fcfee
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-14 19:21:08 +00:00
1 parent afaad7cdc0
commit d38b5260a1
21 files changed
+731 -40

No files matched your search

+1
View File
@@ -672,6 +672,7 @@ impl App {
}
chat_widget.note_rendered_width(tui.terminal.last_known_screen_size.width);
chat_widget.remote_connection = remote_connection;
chat_widget.snapshot_local_images = app_server_target.uses_remote_workspace();
chat_widget.set_local_worktree_operations(!crate::uses_remote_workspace_or_environment(
&app_server_target,
environment_manager.as_ref(),