fix(ui): use HTTP-safe clipboard copy everywhere - #10875
Merged
cryppadotta merged 3 commits intoAug 5, 2026
Merged
Conversation
Use the shared secure-context-aware clipboard helper for issue documents and cover the plain HTTP fallback path. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Route core and first-party plugin copy actions through the shared secure-context fallback and guard against direct clipboard writes. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Contributor
Greptile SummaryThe PR centralizes clipboard writes so core UI and first-party plugin copy actions use the HTTP-compatible fallback.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| ui/src/lib/clipboard.ts | Broadens secure-context detection and retains native-write rejection fallback to the legacy copy path. |
| packages/plugins/sdk/src/ui/clipboard.ts | Adds a typed plugin SDK wrapper that delegates clipboard writes to the host UI runtime. |
| ui/src/plugins/bridge-init.ts | Registers the shared host clipboard helper in the plugin UI bridge initialized before rendering. |
| ui/src/plugins/slots.tsx | Re-exports the clipboard bridge function through dynamically generated plugin SDK UI shims. |
| packages/plugins/plugin-workspace-diff/src/ui/index.tsx | Routes workspace-diff path copying through the plugin SDK clipboard helper. |
| ui/src/lib/clipboard-usage.test.ts | Adds a regression test preventing direct clipboard writes outside the shared implementation. |
Reviews (2): Last reviewed commit: "fix(ui): initialize copy failure toast i..." | Re-trigger Greptile
Co-Authored-By: Paperclip <noreply@paperclip.ing>
teknium1
added a commit
to NousResearch/hermes-agent
that referenced
this pull request
Aug 17, 2026
…ns through the HTTP-safe clipboard helper Self-hosted dashboards served over plain HTTP on a LAN have no navigator.clipboard (insecure context), so every direct writeText call silently failed. web/src/lib/clipboard.ts already ships the HTTP-safe copyTextToClipboard fallback but only OAuthLoginModal used it; ChatPage (OSC 52 + Ctrl/Cmd+Shift+C), ProfilesPage, SystemPage, and WebhooksPage all bypassed it. Route them through the helper and add a source-level regression test that rejects any new direct clipboard write outside lib/clipboard.ts (clipboard reads are exempt: no legacy fallback exists). Sabotage-verified: the guard test fails when a direct write is introduced.
abdulrahman305
pushed a commit
to qenex-ai/hermes-agent
that referenced
this pull request
Aug 17, 2026
…ns through the HTTP-safe clipboard helper Self-hosted dashboards served over plain HTTP on a LAN have no navigator.clipboard (insecure context), so every direct writeText call silently failed. web/src/lib/clipboard.ts already ships the HTTP-safe copyTextToClipboard fallback but only OAuthLoginModal used it; ChatPage (OSC 52 + Ctrl/Cmd+Shift+C), ProfilesPage, SystemPage, and WebhooksPage all bypassed it. Route them through the helper and add a source-level regression test that rejects any new direct clipboard write outside lib/clipboard.ts (clipboard reads are exempt: no legacy fallback exists). Sabotage-verified: the guard test fails when a direct write is introduced.
lisajlau
pushed a commit
to lisajlau/hermes-agent
that referenced
this pull request
Aug 20, 2026
…ns through the HTTP-safe clipboard helper Self-hosted dashboards served over plain HTTP on a LAN have no navigator.clipboard (insecure context), so every direct writeText call silently failed. web/src/lib/clipboard.ts already ships the HTTP-safe copyTextToClipboard fallback but only OAuthLoginModal used it; ChatPage (OSC 52 + Ctrl/Cmd+Shift+C), ProfilesPage, SystemPage, and WebhooksPage all bypassed it. Route them through the helper and add a source-level regression test that rejects any new direct clipboard write outside lib/clipboard.ts (clipboard reads are exempt: no legacy fallback exists). Sabotage-verified: the guard test fails when a direct write is introduced.
bobaba76
pushed a commit
to bobaba76/hermes-agent
that referenced
this pull request
Aug 27, 2026
…ns through the HTTP-safe clipboard helper Self-hosted dashboards served over plain HTTP on a LAN have no navigator.clipboard (insecure context), so every direct writeText call silently failed. web/src/lib/clipboard.ts already ships the HTTP-safe copyTextToClipboard fallback but only OAuthLoginModal used it; ChatPage (OSC 52 + Ctrl/Cmd+Shift+C), ProfilesPage, SystemPage, and WebhooksPage all bypassed it. Route them through the helper and add a source-level regression test that rejects any new direct clipboard write outside lib/clipboard.ts (clipboard reads are exempt: no legacy fallback exists). Sabotage-verified: the guard test fails when a direct write is introduced.
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
…ns through the HTTP-safe clipboard helper Self-hosted dashboards served over plain HTTP on a LAN have no navigator.clipboard (insecure context), so every direct writeText call silently failed. web/src/lib/clipboard.ts already ships the HTTP-safe copyTextToClipboard fallback but only OAuthLoginModal used it; ChatPage (OSC 52 + Ctrl/Cmd+Shift+C), ProfilesPage, SystemPage, and WebhooksPage all bypassed it. Route them through the helper and add a source-level regression test that rejects any new direct clipboard write outside lib/clipboard.ts (clipboard reads are exempt: no legacy fallback exists). Sabotage-verified: the guard test fails when a direct write is introduced.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thinking Path
Linked Issues or Issue Description
Refs #3529.
This change supersedes the stale prior attempt in #3531. Current master has more copy surfaces and a first-party plugin UI bridge that the prior branch does not cover.
What Changed
copyTextToClipboard.Verification
NODE_ENV=test pnpm exec vitest run ...for 14 affected suites: 164 tests passed.pnpm exec vitest run tests/ui-clipboard.test.tsinpackages/plugins/sdk: 1 test passed.NODE_ENV=test pnpm -r typecheck: passed for 31 workspace projects.NODE_ENV=test pnpm test:run: passed.NODE_ENV=production pnpm build: passed.pnpm check:token-gates: passed with all gates clean.Risks
Low risk. Secure contexts still use the modern Clipboard API. Plain HTTP and rejected modern writes use the existing
execCommand("copy")fallback. That API is deprecated, but it is the compatibility path required for insecure contexts. The change has no schema, API, or visual design effect.Model Used
OpenAI Codex,
gpt-5.6-sol. The runtime did not expose a context-window size. Reasoning, tool use, repository editing, test execution, and GitHub CLI access were enabled.Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template#NNN/github.com/paperclipai/paperclipURLs)docs/...,fix/...) and contains no internal Paperclip ticket id or instance-derived details