Skip to content

[codex] Refactor dynamic worker error transport with Effect causes#244

Merged
RhysSullivan merged 3 commits intoRhysSullivan:mainfrom
heyglassy:codex/dynamic-worker-cause-transport
Apr 15, 2026
Merged

[codex] Refactor dynamic worker error transport with Effect causes#244
RhysSullivan merged 3 commits intoRhysSullivan:mainfrom
heyglassy:codex/dynamic-worker-cause-transport

Conversation

@heyglassy
Copy link
Copy Markdown
Contributor

@heyglassy heyglassy commented Apr 14, 2026

Summary

  • replace the dynamic worker's string-only error transport with a structured internal envelope derived from Effect causes
  • preserve the existing outward execution contract and user-facing error strings while keeping structured failures intact across the worker boundary
  • rethrow structured tool failures through the worker transport so plain objects render as JSON instead of collapsing to [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 run

Notes

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.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 14, 2026

Open in StackBlitz

@executor/sdk

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/sdk@244

@executor/plugin-file-secrets

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-file-secrets@244

@executor/plugin-google-discovery

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-google-discovery@244

@executor/plugin-graphql

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-graphql@244

@executor/plugin-keychain

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-keychain@244

@executor/plugin-mcp

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-mcp@244

@executor/plugin-onepassword

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-onepassword@244

@executor/plugin-openapi

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-openapi@244

@executor/plugin-workos-vault

npm i https://pkg.pr.new/RhysSullivan/executor/@executor/plugin-workos-vault@244

commit: 4ed92df

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.
@heyglassy heyglassy marked this pull request as ready for review April 14, 2026 20:40
Comment thread packages/kernel/runtime-dynamic-worker/src/executor.ts
@RhysSullivan RhysSullivan merged commit b3b03be into RhysSullivan:main Apr 15, 2026
5 checks passed
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.

2 participants