-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Open
Labels
webRelates to opencode on web / desktopRelates to opencode on web / desktop
Description
Description
When launching opencode-desktop on Linux (Wayland/X11), the app throws NotFoundError for session JSON files that don't exist yet in the storage directory.
Environment
- OS: Linux (Arch/CachyOS), Kernel 6.18.9
- Desktop: Wayland (forced X11 via
WEBKIT_DISABLE_DMABUF_RENDERER=1) - CLI version: 1.1.53
- App version: 1.1.53
Steps to Reproduce
- Run
WEBKIT_DISABLE_DMABUF_RENDERER=1 opencode-desktop - App starts, sidecar spawns on a port, server becomes ready
- Two
NotFoundErrorexceptions are thrown immediately
Error Output
opencode server listening on http://127.0.0.1:35895
Server ready after 662.897834ms
NotFoundError: NotFoundError
data: {
message: "Resource not found: /home/<user>/.local/share/opencode/storage/session/global/ses_3baf5522dffeiWPuSV70LW2NXb.json",
},
at <anonymous> (src/storage/storage.ts:205:15)
NotFoundError: NotFoundError
data: {
message: "Resource not found: /home/<user>/.local/share/opencode/storage/session/global/ses_3baf4d5d4ffegHx1UI2qa9a5OS.json",
},
at <anonymous> (src/storage/storage.ts:205:15)
Analysis
The error originates from src/storage/storage.ts:205 in the withErrorHandling wrapper. It catches ENOENT errors and re-throws as NotFoundError.
It appears the app tries to read session files (ses_*.json) that don't exist on disk. This could be:
- Stale session references pointing to deleted/missing files
- Missing graceful handling for first-run or cleaned storage scenarios
- Session index referencing IDs whose backing files were never created or were cleaned up
Expected Behavior
The app should handle missing session files gracefully — either by creating them, removing stale references, or silently skipping — instead of throwing unhandled NotFoundError exceptions to stderr.
Additional Context
The Wayland warning is unrelated:
"Wayland session detected; forcing X11 backend to avoid compositor protocol errors. Set OC_ALLOW_WAYLAND=1 to keep native Wayland."
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
webRelates to opencode on web / desktopRelates to opencode on web / desktop