You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproduced on v1.18.29 (Linux arm64, opencode web bound to a Tailscale IP, opened from another machine as http://<magicdns-name>:4096). Same symptom: drop / paste / attach button all silently discard the file, no toast. Console: TypeError: Cannot read properties of undefined (reading 'digest') at putBlob → blobID (packages/app/src/utils/draft-store.ts).
One detail that may explain why this keeps being re-reported: the fix merged for #41706 — #42706 (2026-08-15) — went into the v2 branch, not dev. dev and the v1.18.x tags still call crypto.subtle.digest unconditionally (draft-store.ts:25, and blobReference in packages/session-ui/src/v2/components/prompt-input/attachments.ts:225 for the V2 composer), so 1.18.27 / 1.18.29 still fail. The PRs open against dev (#41710, #44735, #45263, #46418) are the ones that would actually reach a release.
Workaround that worked for us without touching the client: make the origin a secure context. tailscale serve --bg --https=443 http://<bind-ip>:4096 gives an https://<name>.ts.net URL (requires "Enable HTTPS" in the tailnet DNS settings). On that origin isSecureContext is true and attachments work end-to-end — verified with a headless-Chromium drop test against the real bundle; opencode run --attach https://… works through it as well. http://localhost works too, as noted above.
Confirming this is still present on v1.18.31 (latest release, 2026-09-14), on macOS arm64 with opencode web --hostname 0.0.0.0, opened from another machine as http://192.168.x.x:4096.
Repro and evidence from this instance:
Attach via the "+" button → no chip, no toast, nothing in the console UI; message sends text-only.
Server DB (~/.local/share/opencode/opencode.db) shows the user messages with text parts only, zero file parts. Network request to POST /session/{id}/prompt_async carries parts = [{type:"text"}] only, so the attachment never leaves the browser.
Bundle inspection of the served index-*.js matches the source: blobID() (packages/app/src/utils/draft-store.ts) calls crypto.subtle.digest("SHA-256", ...) unconditionally, and the hidden <input type=file> change handler calls addAttachments() without await/.catch, so the TypeError: Cannot read properties of undefined (reading 'digest') rejects unhandled — hence the fully silent drop.
Notably uuid() in the same app already guards with globalThis.isSecureContext; blobID() is the remaining unguarded call site (plus the V2 composer path noted above).
Workaround confirmed working: tunnel the port and use http://localhost:4096 from the client (ssh -L 4096:localhost:4096 user@host), since localhost is a secure context. HTTPS origins work too.
Same failure here on Firefox 156.0 (x86_64) with opencode v1.18.32 — web UI on a plain-HTTP origin accessed from another host over a WireGuard IP, so this isn't Chromium-specific. Firefox just words it differently:
Uncaught (in promise) TypeError: can't access property "digest", crypto.subtle is undefined
putBlob → addAttachments
A workaround for people who can't switch to localhost or put TLS in front (WG/Tailscale/LAN access): Firefox can mark specific hosts as secure contexts. Create dom.securecontext.allowlist in about:config as a string pref, set it to the server IP/hostname (comma-separated; host only — no scheme, no port; parsed in dom/security/nsMixedContentBlocker.cpp), restart the browser. window.isSecureContext becomes true on the same http://<ip>:<port> origin, crypto.subtle is available again, and attachments work end-to-end. Verified on the setup above.
Obviously still worth the client-side fallback (getRandomValues / pure-JS SHA-256) — the pref only helps Firefox users who control their own browser config.
It falls back to crypto.getRandomValues when crypto.subtle is missing or throws, in both the app and v2 composer paths, plus a catch around draftStore.putBlob.
Tested over LAN on plain http from a second machine: the thumbnail appears and the model reads the text in the image back correctly.
If you can, please test it on a dev build and leave a reaction.
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.
Activity
supremest commentedon Sep 8, 2026
Reproduced on v1.18.29 (Linux arm64,
opencode webbound to a Tailscale IP, opened from another machine ashttp://<magicdns-name>:4096). Same symptom: drop / paste / attach button all silently discard the file, no toast. Console:TypeError: Cannot read properties of undefined (reading 'digest')atputBlob→blobID(packages/app/src/utils/draft-store.ts).One detail that may explain why this keeps being re-reported: the fix merged for #41706 — #42706 (2026-08-15) — went into the
v2branch, notdev.devand the v1.18.x tags still callcrypto.subtle.digestunconditionally (draft-store.ts:25, andblobReferenceinpackages/session-ui/src/v2/components/prompt-input/attachments.ts:225for the V2 composer), so 1.18.27 / 1.18.29 still fail. The PRs open againstdev(#41710, #44735, #45263, #46418) are the ones that would actually reach a release.Workaround that worked for us without touching the client: make the origin a secure context.
tailscale serve --bg --https=443 http://<bind-ip>:4096gives anhttps://<name>.ts.netURL (requires "Enable HTTPS" in the tailnet DNS settings). On that originisSecureContextis true and attachments work end-to-end — verified with a headless-Chromium drop test against the real bundle;opencode run --attach https://…works through it as well.http://localhostworks too, as noted above.degomon commentedon Sep 19, 2026
Confirming this is still present on v1.18.31 (latest release, 2026-09-14), on macOS arm64 with
opencode web --hostname 0.0.0.0, opened from another machine ashttp://192.168.x.x:4096.Repro and evidence from this instance:
~/.local/share/opencode/opencode.db) shows the user messages withtextparts only, zerofileparts. Network request toPOST /session/{id}/prompt_asynccarriesparts = [{type:"text"}]only, so the attachment never leaves the browser.index-*.jsmatches the source:blobID()(packages/app/src/utils/draft-store.ts) callscrypto.subtle.digest("SHA-256", ...)unconditionally, and the hidden<input type=file>change handler callsaddAttachments()withoutawait/.catch, so theTypeError: Cannot read properties of undefined (reading 'digest')rejects unhandled — hence the fully silent drop.uuid()in the same app already guards withglobalThis.isSecureContext;blobID()is the remaining unguarded call site (plus the V2 composer path noted above).Workaround confirmed working: tunnel the port and use
http://localhost:4096from the client (ssh -L 4096:localhost:4096 user@host), since localhost is a secure context. HTTPS origins work too.iamironz commentedon Sep 26, 2026
Same failure here on Firefox 156.0 (x86_64) with opencode v1.18.32 — web UI on a plain-HTTP origin accessed from another host over a WireGuard IP, so this isn't Chromium-specific. Firefox just words it differently:
Attach button / drag-drop / paste: all silently discarded, message sends text-only.
A workaround for people who can't switch to
localhostor put TLS in front (WG/Tailscale/LAN access): Firefox can mark specific hosts as secure contexts. Createdom.securecontext.allowlistinabout:configas a string pref, set it to the server IP/hostname (comma-separated; host only — no scheme, no port; parsed indom/security/nsMixedContentBlocker.cpp), restart the browser.window.isSecureContextbecomestrueon the samehttp://<ip>:<port>origin,crypto.subtleis available again, and attachments work end-to-end. Verified on the setup above.Obviously still worth the client-side fallback (
getRandomValues/ pure-JS SHA-256) — the pref only helps Firefox users who control their own browser config.ChristopheAwad commentedon Oct 1, 2026
Fix is open against dev: #52529.
It falls back to crypto.getRandomValues when crypto.subtle is missing or throws, in both the app and v2 composer paths, plus a catch around draftStore.putBlob.
Tested over LAN on plain http from a second machine: the thumbnail appears and the model reads the text in the image back correctly.
If you can, please test it on a dev build and leave a reaction.
thdxr commentedon Oct 11, 2026
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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊