Skip to content

feat(desktop): write bounded clipboard images - #142

Merged
iamnbutler merged 1 commit into
mainfrom
codex/desktop-clipboard-image-write
Oct 6, 2026
Merged

iamnbutler merged 1 commit into
mainfrom
codex/desktop-clipboard-image-write

Conversation

@iamnbutler

@iamnbutler iamnbutler commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Add desktop_clipboard_write({format: "image", path: "/absolute/image"}) alongside the existing {text} call. The host reads one bounded regular file into memory; Ace's GUI decodes one complete PNG/JPEG/TIFF frame before writing the original bytes and image type through the existing clipboard reservation gate. Input is limited to 10 MiB and 64 million pixels. Results contain native outcomes and source metadata; a preview requires an explicit image read.

Part of githubnext/desktop-tools#3 and githubnext/ace2#8. This adds persistent image writes without pasting, preserving prior contents, or creating another store. Interrupted writes retain the existing unsafe replay behavior. File-reference writes, broader temporary paste, and hosted/lifecycle validation remain in githubnext/desktop-tools#3.

Validation at 86e0c1e:

  • CI, type checks, formatting/lint, signed development build, strict app/client/dylib/launcher signatures, and independent source review passed.
  • Four real native writes preserved exact original bytes and image type: transparent PNG, oriented JPEG, TIFF, and a complete PNG padded to exactly 10 MiB. Explicit image reads verified transparency, rotation direction, and the TIFF preview's white JPEG conversion. Nine refusals preserved the clipboard generation: multiple frames, malformed/unsupported images, over 10 MiB, over 64 million pixels, empty source, directory, FIFO, and pre-cancelled input.
  • A real Claude Opus 5.5 channel called image write once and image read once. Closing the worker and reopening on a distinct PID preserved the exact result/image, provider usage, and tool counts without new execution.
  • During one actual delayed paste, a read left the pending reservation intact and the image write refused before mutation. The receiver consumed the public payload; after its exact process exited, the next explicit image write succeeded normally. Each phase restored the original clipboard privately, and all 21 owned processes, validation channel/project, ports, socket, preferences, and pending reservation were cleaned up.

Built in Ace

Direct Codex file, terminal, and GitHub tools were used under Nate's temporary authorization to complete githubnext/ace2#8 faster. Source editing outside Ace is tracked by #22, and Codex orchestration in Ace by #9. The native checks used Ace's actual signed GUI bridge, host adapter, and real channel tools with a saved provider credential, while Codex coordinated the isolated public fixtures and recovery evidence for the clipboard capability being added in githubnext/desktop-tools#3. Original clipboard contents stayed only in the fixture GUI's memory and were never logged, saved, or sent to a provider.

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