fix(server): return 404 when a location folder is missing by rekram1-node · Pull Request #52668 · anomalyco/opencode · GitHub
Skip to content

fix(server): return 404 when a location folder is missing - #52668

Merged
rekram1-node merged 6 commits into
v2from
directory-http-errors
Oct 3, 2026
Merged

rekram1-node merged 6 commits into
v2from
directory-http-errors

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #50951.

A saved project whose folder no longer exists made project requests (/api/model, /api/integration, session permission/form/instructions, …) fail with HTTP 500.

  • Instance.layer keeps FileSystem.DirectoryNotFoundError as a typed failure instead of turning it into a defect; every other boot failure is still a defect.
  • The location, session, and form middleware map it to a new Protocol LocationNotFoundError (404) with { location: { directory }, message }.
  • Locations retry after a failed build, so the folder works again once it is recreated.

Access-denied folders are out of scope and still return 500.

Tests: HTTP test covering the 404 on each affected endpoint and recovery after the folder is created. bun run check and packages/sdk verify:package pass.

@rekram1-node rekram1-node changed the title fix(server): return typed directory availability errors fix(server): return 404 when a location folder is missing Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant