Skip to content

[kernel-1028] add api clipboard support#162

Merged
archandatta merged 8 commits intomainfrom
archand/kernel-1028/api-for-vm-clipboard
Feb 26, 2026
Merged

[kernel-1028] add api clipboard support#162
archandatta merged 8 commits intomainfrom
archand/kernel-1028/api-for-vm-clipboard

Conversation

@archandatta
Copy link
Contributor

@archandatta archandatta commented Feb 25, 2026

Note

Medium Risk
Adds new API surface that reads/writes the X11 clipboard by invoking xclip, which can be fragile across display/env setups and affects host/container state. Changes are otherwise localized with an e2e test and image dependency update.

Overview
Adds clipboard support to the computer API via new POST /computer/clipboard/read and POST /computer/clipboard/write endpoints, wired through generated OAPI types/clients and implemented in computer.go using xclip (with serialized access via inputMu).

Updates the headless Chromium Docker image to install xclip, and adds an e2e test (TestClipboardHeadless) that verifies the new routes exist in spec.yaml and that a write followed by read round-trips the expected text.

Written by Cursor Bugbot for commit eefd81d. This will update automatically on new commits. Configure here.

@archandatta archandatta force-pushed the archand/kernel-1028/api-for-vm-clipboard branch from 6aeb396 to 44eda3e Compare February 25, 2026 14:14
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Contributor

@rgarcia rgarcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did you test this?

@archandatta
Copy link
Contributor Author

how did you test this?

yeah sorry i should've included this!

Screen.Recording.2026-02-25.at.3.13.03.PM.mov

@rgarcia
Copy link
Contributor

rgarcia commented Feb 25, 2026 via email

Copy link
Contributor

@Sayan- Sayan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exciting stuff! also sanity checking you tested headless?

defer s.inputMu.Unlock()

display := s.resolveDisplayFromEnv()
cmd := exec.CommandContext(ctx, "xclip", "-selection", "clipboard", "-o")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this included for both headful + headless images?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good catch! I added the xclip to the headless image! a35b3d1

@archandatta archandatta force-pushed the archand/kernel-1028/api-for-vm-clipboard branch from a7007ff to a35b3d1 Compare February 26, 2026 13:43
@archandatta archandatta requested a review from Sayan- February 26, 2026 13:43
@archandatta archandatta merged commit 440856c into main Feb 26, 2026
5 checks passed
@archandatta archandatta deleted the archand/kernel-1028/api-for-vm-clipboard branch February 26, 2026 19:42
@eclairen
Copy link

@archandatta - including this in the changelog! can you update the API docs with the new endpoints?

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.

4 participants