Skip to content

Read bounded clipboard file references - #139

Merged
iamnbutler merged 2 commits into
mainfrom
codex/desktop-clipboard-files
Oct 5, 2026
Merged

iamnbutler merged 2 commits into
mainfrom
codex/desktop-clipboard-files

Conversation

@iamnbutler

@iamnbutler iamnbutler commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Add desktop_clipboard_read({format: "files"}) for githubnext/desktop-tools#3 and githubnext/ace2#8. It returns up to 32 ordered, explicitly advertised local file URLs and decoded paths in a complete 24 KB JSON result. The GUI uses existing silent clipboard permission and stable-generation checks. Ordinary alternate representations are allowed; visible promises, legacy-only lists, mixed file/non-file items, invalid/nonlocal URLs, and unreadable or oversized data refuse without a partial result.

No referenced file is opened or inspected, no path is canonicalized, and no clipboard mutation, reservation admission, backup, or new store is added. macOS may filter references before exposing them to Ace, so present: false does not establish what the originating app published or whether files exist.

Validation:

  • Type checks, formatting/lint, Swift parsing, and independent source review passed after integrating main's launch and menu support. The file-read native patch, client, host projection/dispatch, and channel schema/replay are byte-identical to the live-tested ecaef60 implementation.
  • Signed final build and strict app/client/dylib signature verification: passed at 6936419fa80344d5c464143753ef12eb3a514ae3; GitHub CI is green.
  • Nine real native cases passed: ordered Unicode/spaces/directory/duplicate references, 32 entries, a complete 23,277-byte result, absence, and exact refusals for mixed items, promises, unreadable references, >32 items, and >24 KB results.
  • Three malformed/remote/file-reference cases were filtered by macOS and correctly returned absent; they do not claim native guard coverage. AppKit rejected the legacy-format fixture before a product read, so that guard has source review only.
  • A real gpt-6-sol channel read the known public list once. Closing/reopening its store preserved the exact result, usage, and tool counts without another execution or clipboard change.
  • Every phase restored the privately held original clipboard only while the fixture owned its generation. All owned vaults, apps, hosts, workers, channels, projects, ports, and sockets were cleaned up; private clipboard contents were never logged or persisted.

Built in Ace

Real native checks ran through the signed Ace GUI/host, and the model/replay check used a real Ace channel. Codex used external source, Git, build, and temporary validation tooling under the user's temporary exception for githubnext/ace2#8. Ace cannot yet host this Codex harness (#9) and lacks a File tab for direct source editing (#22).

@iamnbutler
iamnbutler marked this pull request as ready for review October 5, 2026 23:21
@iamnbutler
iamnbutler merged commit aa48e89 into main Oct 5, 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