Skip to content

Bug: All copy buttons in the web UI silently fail when accessed over HTTP (non-secure context) #17553

Closed as not planned

Description

@Hastyshell

Description

Problem

All copy buttons in the web UI (code block copy, assistant response copy, shell output copy, copy path, etc.) silently fail when the app is accessed over a non-secure context (e.g. HTTP over LAN via `opencode web`).

Root cause

Every copy handler called navigator.clipboard.writeText() directly. The Clipboard API requires a secure context (HTTPS or localhost). When the server is accessed via a local network IP (http://192.168.x.x:PORT), the browser rejects the call — and because most handlers had no error handling, the rejection was silently swallowed, making buttons appear to do nothing.

The only working copy in the whole app was the share-URL copy in use-session-commands.tsx, which already had a document.execCommand("copy") fallback.

Plugins

No response

OpenCode version

1.2.25

Steps to reproduce

  1. Run opencode web --hostname 0.0.0.0 --port 39769 and access the UI from another device or via LAN IP (HTTP, not localhost)
  2. Open any session with file context
  3. Click the "Copy path" button on any file reference
  4. Nothing happens — no feedback, no copy

Screenshot and/or share link

No response

Operating System

NixOS 25.11

Terminal

No response

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    webRelates to opencode on web / desktop
    on Mar 15, 2026
  2. github-actions commented on Mar 15, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue adds new context or scope beyond #14803, please clarify the differences. Otherwise, consider continuing the discussion there.

  3. removed
    bugSomething isn't working
    webRelates to opencode on web / desktop
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions