Skip to main content

Module executor

Module executor 

Source
Expand description

Sandbox executor — creates fresh V8 isolates and runs LLM-generated code.

Each execution gets a brand new runtime. No state leaks between calls.

V8 isolates are !Send, so all JsRuntime operations run on a dedicated thread with its own single-threaded tokio runtime. The public API is fully async and Send-safe.

Structs§

SandboxConfig
Configuration for the sandbox executor.
SandboxExecutor
The sandbox executor. Creates fresh V8 isolates for each execution.

Enums§

ExecutionMode
How the sandbox executes code.

Functions§

create_runtime
Create a fresh JsRuntime with the forge extension loaded and V8 heap limits set.
run_execute
Run an execute operation on the current thread.
run_search
Run a search operation on the current thread (must be called from a dedicated thread, not the main tokio runtime).