Skip to content

Desktop: ship image attachments to the box, so a remote agent can actually see them - #129

Merged
pallaoro merged 1 commit into
mainfrom
let-s-find-a-solution
Aug 19, 2026
Merged

Desktop: ship image attachments to the box, so a remote agent can actually see them#129
pallaoro merged 1 commit into
mainfrom
let-s-find-a-solution

Conversation

@pallaoro

Copy link
Copy Markdown
Member

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: new handleFor(ownerId, …) + ownerKind(ownerId) so an id-less call like util:writeImageBytes routes 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.
  • Protocol renames stageClipboardImage/stageImagePathattachImages/attachClipboardImage with 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.

…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
pallaoro enabled auto-merge (squash) August 19, 2026 09:52
@pallaoro
pallaoro merged commit 21170a0 into main Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant