Skip to content

refactor(errors): make ToolInvocationError schema-backed#883

Draft
RhysSullivan wants to merge 1 commit into
effect/tracing-sweepfrom
effect/error-model
Draft

refactor(errors): make ToolInvocationError schema-backed#883
RhysSullivan wants to merge 1 commit into
effect/tracing-sweepfrom
effect/error-model

Conversation

@RhysSullivan
Copy link
Copy Markdown
Owner

Makes ToolInvocationError schema-backed.

It was the only Data.TaggedError in the 16-member ExecutorError union, so converting it (causeSchema.optional(Schema.Defect)) makes the whole union — which is returned across the SDK/MCP wire — fully schema-encodable.

Investigation showed the remaining Data.TaggedError errors are either internal or mapped to a ToolResult failure before the wire (the "module-private" exception), so they intentionally stay as Data. This is a tighter scope than the original audit assumed — the error model was closer to good than expected.

Stacked on #882.

Verified: typecheck (all 38 packages), lint (0/0), format, sdk tests.

Draft.

Convert `ToolInvocationError` from `Data.TaggedError` to `Schema.TaggedErrorClass`
(`cause` -> `Schema.optional(Schema.Defect)`). It was the only non-schema member of
the `ExecutorError` union, so the whole union — which is returned across the SDK/MCP
wire — is now fully schema-encodable.

The remaining `Data.TaggedError` errors are internal or mapped to `ToolResult` before
the wire (the module-private exception), so they stay as-is.

Verified: typecheck (all 38 packages), lint (0/0), format, sdk tests.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 2, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 8947866 Jun 02 2026, 05:49 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 2, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 8947866 Commit Preview URL

Branch Preview URL
Jun 02 2026, 05:48 PM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 2, 2026

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@883

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@883

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@883

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@883

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@883

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@883

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@883

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@883

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@883

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@883

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@883

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@883

executor

npm i https://pkg.pr.new/executor@883

commit: 8947866

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