Repository navigation
Description
Description
When a saved project folder is missing, or when macOS blocks access to it, project requests to the local server fail with HTTP 500. Examples are GET /api/integration and GET /api/model. Desktop then can't load models or integrations, and nothing tells the user that the folder is the cause.
Windows: folder moved or deleted. Recreating the folder at its original path restores access. Example (fictional path, redacted from the supplied log):
PlatformError: NotFound: FileSystem.realPath (C:\Users\Test User\Projects\missing-project)
[cause]: ENOENT: no such file or directory, lstat 'C:\Users\Test User\Projects\missing-project'
macOS: access blocked by privacy settings. The error arrives as PlatformError: Unknown with an EPERM cause, not as a permission error. Server log (user path replaced with a fictional one):
timestamp=2026-09-23T16:25:52.826Z level=INFO run=7c7987d0 cause="PlatformError: Unknown: FileSystem.realPath (/Users/example/Documents)
at Lf (/$bunfs/root/chunk-zr73h8af.js:2:721)
at <anonymous> (/$bunfs/root/chunk-bh8xr96x.js:24:40210)
at guarded (internal:shared:112:26)
at processTicksAndRejections (native:7:39)
at FileSystem.resolve (/$bunfs/root/chunk-m1pd9hsp.js:123:34410)
at FileSystem.resolve (definition) (/$bunfs/root/chunk-fw24wvty.js:9:89799)
at ConfigDiscovery.discover (/$bunfs/root/chunk-m1pd9hsp.js:123:41501)
at ConfigDiscovery.discover (definition) (/$bunfs/root/chunk-m1pd9hsp.js:123:34024)
at ServerProcess.start (/$bunfs/root/chunk-qq8x7a52.js:2:6440)
at ServerProcess.start (definition) (/$bunfs/root/chunk-38hy4y2f.js:436:22432) {
[cause]: Error: EPERM: operation not permitted, lstat '/Users/example/Documents'
}" http.span=72 role=server http.method=GET http.url=/api/model http.status=500
The macOS failure showed up in Desktop as a full-page ClientError: UnexpectedStatus (HTTP 500) error, and restarting didn't help.
Plugins
Unknown for the affected installations.
OpenCode version
v2.0.15
Steps to reproduce
Windows:
- Open a project in the desktop app.
- Close the app and move or delete the project directory.
- Reopen the app and select the saved project. Project requests fail and models are missing.
macOS:
- Open a project inside a privacy-protected folder, such as
~/Documents. - Deny OpenCode access to that folder under System Settings > Privacy & Security > Files & Folders.
- Reopen the app. Project requests fail with HTTP 500.
Screenshot and/or share link
None for the Windows report. The macOS report showed the full-page HTTP 500 error screen.
Operating System
Windows (version not provided); macOS (version not provided).
Terminal
Desktop app (no terminal).
Activity
[-]desktop: missing project folder breaks project requests[/-][+]desktop: missing or inaccessible project folder breaks project requests[/+]haoyangzhang99 commentedon Oct 3, 2026
Another data point on v2.0.22 (Desktop, macOS 27 / Darwin 27.0.0 arm64), which doesn't include #52668 yet.
How the stale projects appeared: I ran
opencode run --standalone(the 2.0.22 CLI bundled with Desktop) in four throwaway folders under OpenCode's own temp directory ($TMPDIR/opencode/<name>), then deleted the folders. All four stayed in the shared project list.GET /api/projecton the Desktop service still lists them with the deleted path insandboxes, even though those runs used a private server.Symptom: while no session was running, Desktop repeatedly showed "request failed" (HTTP 500) errors. The service log shows bursts of
GET /api/mcp/resourceandGET /api/mcpfor three of the deleted folders, minutes apart (12 errors between 17:56 and 18:15 UTC):Direct reproduction:
opencode api get /api/mcp --header 'x-opencode-directory:<deleted folder>'returns 500. The same request for an existing folder returns 200.Two things worth checking against #52668 and #50952:
LocationNotFoundErrorquietly outside session and draft tabs.--standaloneruns register permanent projects, and there's no supported way to remove a project. Cleanup currently means recreating the folder or editingopencode.db.Environment: OpenCode Desktop and service 2.0.22 (latest), zsh. Local plugins: two unrelated ones (system-prompt rewording and a status-bar bridge); neither calls MCP routes.
Related: #50548, #49442.
kaantokgozsec-hash commentedon Oct 11, 2026
Verified data point on Desktop 2.0.26 (Windows): the server side of #52668 works — Desktop still dead-ends silently
Environment: Desktop 2.0.26 (bundled
opencode-cli.exe2.0.26, local daemon on127.0.0.1:49374), Windows 11 10.0.26200, channellatest, no plugins configured. Username redacted below as<user>.What happened: a project folder was moved while it was open in Desktop (
C:\Users\<user>\Desktop\shorts_pipeline→C:\Users\<user>\Desktop\distribution_coordinator\shorts_pipeline). After restart:%APPDATA%\ai.opencode.desktop(drafts.sqliteplus persisted tab/session info), so the stale path survives reinstalls.Server behavior on 2.0.26 (the packaged daemon already includes #52668):
For an existing directory the same request returns
200with the full model list. So the 500/PlatformErrorshape from the original 2.0.15 report is gone; the renderer just doesn't consume the structured error yet.Where the client drops it (from the served renderer bundle
_assets/incompatible-server-panel-DTx7zmni.js, 2.0.26):let c=ai(e);if(!c){e.notify.missingSelection();return}—ai()returns nothing oncemodel.selection.current()is null;get modelControlsVisible(){return !e.model.model.loading}— with the model request failing,loadingstays true, so the control is removed from the DOM instead of showing an error state.Workaround that restored full function (without moving files back):
then
opencode reload.GET /api/modelreturns 200 again and the composer recovers. Might be worth a docs/FAQ note for users onlatestuntil #50952 ships.Happy to verify a staged build of #50952 against this exact setup (Windows 11, Desktop 2.0.26) if useful.
digisus commentedon Oct 12, 2026
Reproduced on Linux (Debian 13, desktop 2.0.16, bundled CLI 2.0.16) after a project folder was moved from
~/Documents/CODINGto~/Coding. SamePlatformError: NotFound: FileSystem.realPath500s, plus two aspects not covered above:1. It is fatal, not degrading. The renderer dies with
ClientError: UnexpectedStatus: 500on every launch and the app is stuck on the error screen — no way to switch projects or dismiss it from the UI. Recovery required stopping the app and repairing state manually.2. Sessions stranded in a missing directory are polled in an unbounded retry loop. From the server log while the folder was missing:
/api/session/<id>/permission/api/session/<id>/form/api/location/api/provider·/api/modelThe session polls had no backoff and never gave up. Sessions whose directory is gone keep 500ing forever —
GET /api/session/<id>/permissionstill returns 500 for them, and there is no API to re-home a session (onlyPATCH /api/project/{id}{"canonical": ...}exists for projects; I used it successfully, plus direct DB edits for the 4 stranded sessions).Suggestions:
neriousy commentedon Oct 23, 2026
Preserving the Desktop fatal-rename details from #49442: on Desktop 2.0.22/Linux, renaming a stale project entry led to a repeatable HTTP 500 startup lockout; removing that entry from
drafts.sqliterestored startup. A related report says failed location resolution still bumpstime_active, keeping dead projects at the top of the recent-project list.opencodejr commentedon Oct 28, 2026
Thanks for the detailed report. I reproduced both cases with the local server, without Desktop.
I ran
opencode serve(v2.0.15), opened a few project folders, then deleted one and made another unreadable (chmod 000on Linux, which is close to macOS blocking a folder). After restarting the server,GET /api/modelandGET /api/integrationreturned HTTP 500 with an empty body for both folders. The script below reproduces it.On the latest
dev(fa1260d):LocationNotFoundErrorinstead of 500. Desktop has a "location missing" prompt for this case, so that part looks fixed for the next release.DirectoryAccessDeniedError: Access denied to directory), but it doesn't pass that on to the app, so the app can't tell you the folder is blocked. This matches the full-pageUnexpectedStatuserror you saw.Until this is fixed, you can work around the macOS case by allowing OpenCode access under System Settings > Privacy & Security > Files & Folders, or by moving the project out of the protected folder. I've passed this to the maintainers.
Reproduction script (repro.sh)
Run it:
bash repro.sh