[codex] Refactor dynamic worker error transport with Effect causes#244
Merged
RhysSullivan merged 3 commits intoRhysSullivan:mainfrom Apr 15, 2026
Merged
Conversation
Replace the dynamic worker runtime's string-only error transport with a structured internal envelope derived from Effect causes. Preserve the external execution contract and user-facing error strings while preventing object-shaped failures from collapsing to [object Object]. Re-throw structured tool failures through the worker boundary, render plain objects as JSON in final output, and add workerd-backed tests covering tagged failures, object failures, defects, interruptions, and execution-time thrown objects. Verified with bun x vitest run in packages/kernel/runtime-dynamic-worker.
@executor/sdk
@executor/plugin-file-secrets
@executor/plugin-google-discovery
@executor/plugin-graphql
@executor/plugin-keychain
@executor/plugin-mcp
@executor/plugin-onepassword
@executor/plugin-openapi
@executor/plugin-workos-vault
commit: |
Replace the dynamic worker runtime's string-only error transport with a structured internal envelope derived from Effect causes. Preserve the external execution contract and user-facing error strings while preventing object-shaped failures from collapsing to [object Object]. Re-throw structured tool failures through the worker boundary, render plain objects as JSON in final output, restore the original structural comments in the runtime module, and keep the workerd-backed regression coverage for tagged failures, object failures, defects, interruptions, and execution-time thrown objects. Verified with bun x vitest run in packages/kernel/runtime-dynamic-worker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[object Object]Root Cause
The dynamic worker runtime flattened failures at the Workers RPC boundary with ad hoc string conversion. That discarded Effect cause structure and collapsed object-shaped failures to
[object Object]before the execution engine could format them.Validation
cd packages/kernel/runtime-dynamic-worker && bun x vitest runNotes
main, not a follow-up on top of the minimal-fix branch