fix(server): report location permission errors by OpeOginni · Pull Request #51171 · anomalyco/opencode · GitHub
Skip to content

fix(server): report location permission errors - #51171

Closed
OpeOginni wants to merge 2 commits into
anomalyco:devfrom
OpeOginni:folder-access-errors
Closed

OpeOginni wants to merge 2 commits into
anomalyco:devfrom
OpeOginni:folder-access-errors

Conversation

@OpeOginni

@OpeOginni OpeOginni commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Fixes the permission-denied server errors in #50951.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Focuses only on reporting permission errors during Location boot. Builds on #52649 and #52668, which already classify filesystem permission failures and return 404 for missing Location folders.

  • Keeps FileSystem.DirectoryAccessDeniedError typed through Instance.layer instead of turning it into a defect and returning 500.
  • Classifies permission defects from earlier boot steps, such as config discovery, when the denied path is the Location directory or one of its parents. Handles EACCES and macOS privacy denials reported as EPERM; unrelated failures remain defects.
  • Returns LocationPermissionDeniedError (403) through the existing Location error mappings, with the corresponding Protocol and generated client declarations.

No new filesystem checks are added. location.get, filesystem boot canonicalization, and the Workerd filesystem replacement match v2. Cached Locations are not rechecked when their folders become inaccessible after boot. Missing-folder behavior and desktop UI are unchanged.

How did you verify your code works?

  • bun run check from the repository root.
  • 65 focused tests passed across server fetch, Workerd, Location filesystem, Location layer, and session movement suites.
  • Permission coverage in packages/server/test/fetch.test.ts verifies that a denied parent folder returns 403 for model and Location requests, recovers after access is restored, and does not recheck cached access after permissions are revoked again.
  • Existing missing-folder 404 and recovery coverage still passes.
  • Regenerated the client with bun run generate.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Oct 3, 2026
@OpeOginni
OpeOginni force-pushed the folder-access-errors branch from bb76bf3 to fc36bf8 Compare October 3, 2026 18:01
@OpeOginni OpeOginni changed the title fix(server): return typed errors for unavailable project folders fix(server): report denied and lost location folders Oct 3, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@OpeOginni
OpeOginni force-pushed the folder-access-errors branch from fc36bf8 to fc0b100 Compare October 4, 2026 21:26
@OpeOginni OpeOginni changed the title fix(server): report denied and lost location folders fix(server): report location permission errors Oct 5, 2026
@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:17
@OpeOginni OpeOginni closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant