Skip to content

Commit 709a40b

Browse files
tylergibbs1claude
andcommitted
Update README with WorkerExecutor documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cdcc489 commit 709a40b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,13 @@ const agent = new Agent({
437437
// }
438438
```
439439

440-
`createCodeModeTool` generates TypeScript types from your tools, presents the LLM with a single `execute_code` tool, and runs the generated code in an executor. All tool calls happen within one invocation — no round-trips through the model between calls. Implement the `Executor` interface for custom sandboxes (isolated-vm, containers, Cloudflare Workers).
440+
`createCodeModeTool` generates TypeScript types from your tools, presents the LLM with a single `execute_code` tool, and runs the generated code in an executor. All tool calls happen within one invocation — no round-trips through the model between calls.
441+
442+
Two built-in executors:
443+
- **`FunctionExecutor`** — fast, same-process (NOT sandboxed)
444+
- **`WorkerExecutor`** — isolated via `worker_threads` (separate V8 context, no host access)
445+
446+
Implement the `Executor` interface for custom sandboxes (containers, Cloudflare Workers, etc.).
441447

442448
## Imports
443449

0 commit comments

Comments
 (0)