Repository navigation
Description
In plain words
OSS: The copy buttons copy the text, even when the page is served over plain HTTP.
OHE: On a plain-HTTP install, the copy buttons in chat and in code blocks fail, and so does the share-link copy.
Gap
- OSS change: OpenHands/OpenHands#18583 — fix(clipboard): support fallback when Clipboard API is unavailable (shipped in v1.42.0 #19819; fixes OpenHands/OpenHands#18582)
- OSS paths:
src/utils/copy-to-clipboard.ts,src/components/features/chat/chat-message.tsx,src/components/shared/buttons/copyable-content-wrapper.tsx,src/hooks/use-conversation-name-context-menu.ts - Gap key:
gap:canvas/v1.35.0..main/clipboard-fallback#18583· blocker typemissing-integration - Evidence: static inspection of enterprise
mainatac70934. Needs live validation: no.
What OHE is missing
navigator.clipboard exists only in a secure context. On a page served over plain HTTP from a non-loopback host it is undefined, so navigator.clipboard.writeText(...) throws. The OSS change adds one copyToClipboard helper. It tries the async API, falls back to a temporary textarea and execCommand("copy"), and returns whether the text reached the clipboard. The buttons then show "copied" only after a real copy.
OHE has its own copies of three of those call sites, and each still calls navigator.clipboard.writeText directly. The pin bump does not change them. On a plain-HTTP, non-loopback install, the copy button on a chat message and on a code block throws and does nothing. The "copy share link" menu entry throws before its success toast, so it shows nothing. The Compose stack serves the page at the address set in AGENT_CANVAS_LOCK_TO_CLOUD, and that address does not have to be loopback (docker-compose.yml#L174).
Where it belongs in OHE
No settings scope applies: this is a frontend utility change in the legacy frontend/, which the Canvas bundle does not replace.
Target files:
frontend/src/components/features/chat/chat-message.tsx#L30— copy of a chat message.frontend/src/components/shared/buttons/copyable-content-wrapper.tsx#L15— copy of a code block (used bymarkdown/code.tsx).frontend/src/hooks/use-conversation-name-context-menu.ts#L166— "copy share link".- A shared helper under
frontend/src/utils/, ported from the OSScopy-to-clipboard.ts. The same bare call is in five more OHE settings and admin components (api-keys-manager.tsx#L183,new-api-key-modal.tsx#L24,copy-invite-link-button.tsx#L27,configure-modal.tsx#L96,super-admin-auth-provider-edit.tsx#L72). The OSS change has no counterpart for them, so they are optional here.
OHE principles that apply
- P10 Change the right frontend: these components are in the legacy
frontend/, not in the/canvasbundle. The pin bump does not change them, so the fix is a port intofrontend/src/.
Acceptance
- On a page served over plain HTTP from a non-loopback address, the copy button on a chat message and on a code block puts the text on the clipboard, and shows "copied" only after it did.
- "Copy share link" copies the link and shows its success toast.
- A unit test runs the helper with
navigator.clipboardremoved, and checks that the fallback copies the text and returnstrue.
Dependencies
None. The fix does not need the Canvas pin to move. OSS is still refining the helper in OpenHands/OpenHands#19843 (focus-independent fallback, one shared error toast). Port the version on OSS main when you start.
Duplicate check
Searched OpenHands/enterprise issues and pull requests, in any state, for 18583, 18582, clipboard, navigator.clipboard, execCommand, secure context, copy button and plain HTTP, and for the parity marker of this gap. No enterprise issue or pull request covers it. enterprise#1435 and enterprise#1459 mention the clipboard but add new copy controls and do not touch these three files. The closest hit is the OSS bug OpenHands/OpenHands#18582 (closed), the report that the OSS change fixes.
This issue was created by an AI agent (OpenHands) via the OHE OSS gap discovery automation.
Activity
rajshah4 commentedon Nov 19, 2026
The same plain-HTTP limitation applies to Copy version info in #1459. Once #1463 lands, we can switch the About button to the shared
copyToClipboardhelper and test it with the Clipboard API unavailable.