Desktop: ship image attachments to the box, so a remote agent can actually see them - #129
Merged
Conversation
…ually see them The desktop attached images by staging a bitmap on the Mac's clipboard and forwarding Ctrl+V — invisible to an agent running on a box (empty clipboard, or a typed /Users/... path the box doesn't have). Route attaches through the aggregate instead: a remote terminal's images are pushed over the engine RPC (util:writeImageBytes, the flow iOS already proved) and the box-side temp paths are typed into the PTY; local terminals keep the clipboard trick. Every attach surface (drop, paste, picker) now takes multiple images too.
pallaoro
enabled auto-merge (squash)
August 19, 2026 09:52
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.
The desktop attached images by staging a bitmap on the Mac's clipboard and forwarding Ctrl+V — which only a local agent can read. An agent on a box got an empty clipboard, or a typed
/Users/...path the box doesn't have ("Screenshot didn't make it across"). iOS never had the bug: it pushes the bytes over the engine RPC and types the box-side path.The desktop now does the same, deciding per terminal:
aggregate/backend/host: newhandleFor(ownerId, …)+ownerKind(ownerId)so an id-less call likeutil:writeImageBytesroutes to the engine that owns the terminal (it used to always hit the local engine).ipc: remote terminal → read each image, push bytes to the owning box (util:writeImageBytes, temp dir the engine already prunes), return box-side paths for the renderer to TYPE. Local terminal → unchanged clipboard staging + Ctrl+V. A pasted screenshot (raw bitmap) is encoded to PNG off the clipboard and pushed the same way.Terminal.tsx: drop, ⌘V, and the toolbar all use the new delivery; the picker is now multi-select ("Attach images") and a drop/paste of several images attaches them all.stageClipboardImage/stageImagePath→attachImages/attachClipboardImagewith mobile/headless stubs updated. No daemon wire change — existing boxes keep working, no protocol version bump.Known gap left as-is: non-image files dropped into a remote terminal still type their Mac path.
Tests: new aggregate routing test; full suite 156 pass; typecheck + desktop production build green.