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
{{ message }}
Repository navigation
[BUG]: ENOENT when image URL is treated as local file path — breaks TUI rendering #10730
When a message contains a GitHub image URL (e.g., from pasting an image or referencing user-attachments), OpenCode treats the URL as a local file path and attempts to stat() it. This resolves the URL against the CWD, producing an invalid path like:
The Bun.file(filepath).stat() call then throws an unhandled ENOENT error that dumps raw into the TUI, breaking the display.
Root Cause
The code path that processes file attachments/content does not check whether a path is a URL (starts with http:// or https://) before calling stat(). URLs should either be fetched remotely or skipped, not treated as local filesystem paths.
Related
Similar to #8807 (same stat() code path, different trigger — deleted file vs URL-as-path).
Steps to reproduce
Start OpenCode
Paste or reference an image that produces a GitHub user-attachments URL
Submit the message
Observe the ENOENT error rendered in the TUI
Error Output
ENOENT: no such file or directory, stat '/Users/rynfar/repos/opencode-claude-provider/https:/github.com/user-attachments/assets/421a1663-bc87-449f-b50c-6a411baf6417'
path: "/Users/rynfar/repos/opencode-claude-provider/https:/github.com/user-attachments/assets/421a1663-bc87-449f-b50c-6a411baf6417",
syscall: "stat",
errno: -2,
code: "ENOENT"
Expected behavior
URLs should be recognized as remote resources and not passed to stat(). The code should check if a path starts with http:// or https:// before attempting filesystem operations.
Activity
github-actions commentedon Jan 26, 2026
This issue might be a duplicate of existing issues. Please check:
opencode attach: File path duplicates client's relative directory, causing ENOENT #4967: File path duplicates causing ENOENT on server sideFeel free to ignore if none of these address your specific case.
github-actions commentedon Mar 29, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.