Skip to content

Web UI over plain HTTP: sessions appear empty / missing because crypto.subtle and crypto.randomUUID are unavailable on insecure origins #46662

Closed as not planned

Description

@hosein-ul

Summary

When opencode web is accessed over a plain http:// origin (e.g. http://<vps-ip>:4096 — a very common setup for self-hosted VPS users), multiple parts of the web UI silently fail:

  1. Image/file attachments silently fail — crypto.subtle is undefined on insecure origins, so blob ID / digest generation throws and the attachment is never added to the prompt. No toast, no error, nothing. (Already partially reported in Web: image attachments fail on insecure origins; no client-side optimization #46419)
  2. Sessions list appears empty or stale — the UI relies on crypto.randomUUID() / other crypto APIs in several code paths; on insecure origins these throw, and session listing/switching breaks silently. The user sees "0 sessions" or a fresh state even though sessions exist on the server (verified via GET /session over the API — sessions were there all along).

This is a class of bugs rather than a single issue: any web-platform API gated on secure context breaks when self-hosters access the web UI over http://<ip>, which is the default for anyone running opencode web --hostname 0.0.0.0 on a VPS without a domain/TLS setup.

Steps to reproduce

  1. On a VPS: OPENCODE_SERVER_PASSWORD=xxx opencode web --port 4096 --hostname 0.0.0.0
  2. Open http://<vps-ip>:4096 in Chrome/Firefox from a remote machine
  3. Try attaching an image via + → nothing happens, no error
  4. Create a session, refresh — session list may appear empty even though GET /session returns sessions
  5. Repeat the same over http://localhost:4096 (or via an HTTPS reverse proxy / tunnel) — everything works

Expected

Either:

  • Graceful fallbacks (crypto.getRandomValues instead of crypto.subtle.digest, Math.random-based UUID fallback) so the web UI fully works on insecure origins, or
  • A visible warning banner: "You are accessing over an insecure origin; some features (attachments, session management) may not work"

Actual

Silent failure with zero user feedback. Users on VPS deployments think sessions are lost or uploads are broken, and there is no hint that the origin is the problem.

Environment

  • opencode 1.18.25 (web UI, Linux VPS)
  • accessed via http://<ip>:4096 from a remote desktop browser
  • workaround verified: putting an HTTPS reverse proxy (Cloudflare tunnel) in front of the server makes everything work

Related

Thanks!

Activity

  1. github-actions commented on Sep 1, 2026

    @github-actions
    Contributor

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

    Since you've already referenced both in your report, you may want to add any additional context (e.g. the sessions-list appearing empty) as a comment on #46168 rather than tracking it as a separate issue.

  2. hosein-ul commented on Sep 5, 2026

    @hosein-ul
    Author

    hey??????

  3. hosein-ul commented on Sep 5, 2026

    @hosein-ul
    Author
  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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