Skip to content

fix(core): preserve Permission.Error in FileAccess.Interface - #57823

Merged
rekram1-node merged 1 commit into
devfrom
core-file-access-error-type
Oct 21, 2026
Merged

rekram1-node merged 1 commit into
devfrom
core-file-access-error-type

Conversation

@rekram1-node

Copy link
Copy Markdown
Contributor

Problem

FileAccess.Interface.authorizeExternal and FileAccess.Interface.authorizeRead used an unqualified Error in their Effect error unions. Because file-access.ts does not define a local Error type alias, Error resolved to globalThis.Error instead of Permission.Error, collapsing the error union and widening the typed error channel.

Change

Qualify Permission.Error in FileAccess.Interface so callers retain the narrow tagged error union from Permission.Service.assert.

 FileAccess.Interface
   authorizeExternal
-    Effect<void, Error | SessionErrors.NotFoundError>
+    Effect<void, Permission.Error | SessionErrors.NotFoundError>
   authorizeRead
-    Effect<Target, FSUtil.Error | Error | SessionErrors.NotFoundError>
+    Effect<Target, FSUtil.Error | Permission.Error | SessionErrors.NotFoundError>

Out of scope

  • Changing runtime behavior of FileAccess.authorizeExternal or FileAccess.authorizeRead.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problems found. The bare Error here meant the global Error, so qualifying it as Permission.Error is correct and only changes types. The packages/core type check still passes, so the existing callers in tool/plugin/* and the tests compile against the narrower error union, and test/file-access.test.ts passes.

Public API: unchanged (internal FileAccess.Interface types only).

@rekram1-node
rekram1-node merged commit 0c8e7a9 into dev Oct 21, 2026
13 checks passed
@rekram1-node
rekram1-node deleted the core-file-access-error-type branch October 21, 2026 18:07
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