Execute Code Stream
execute_code_streamStream live code execution output and progress updates while the program runs, enabling real-time monitoring before completion, with configurable limits for memory, CPU, and output size.
Instructions
Execute code and STREAM progress + partial output as it runs. Use this, not execute_code/run_submit/session_run, for the same run when you want output while it runs, up to a 300s cap.
Reports progress notifications to the client while the program runs, so agents can see output before the process finishes. Returns the same result shape and applies the SAME ceilings as execute_code: max_memory_mb, max_output_kb and max_cpu are forwarded to the executor exactly as execute_code forwards them, including the same 240 KiB per-stream clamp.
dependencies: same as execute_code's (PEP 723 merge, no_net/policy
refusal, 120s budget, workdir quota) — installed before streaming
starts; a refusal/failed install is the stream's only event.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Source code to run in `language` | |
| stdin | No | Text piped to the program's standard input; empty means no input | |
| no_net | No | Block outbound network access for this run; best-effort on platforms without seccomp | |
| max_cpu | No | Per-call CPU-time ceiling in seconds; 0 means no explicit limit is set | |
| timeout | No | Wall-clock seconds before the run is killed; clamped to a 300s ceiling (longer than execute_code's) | |
| language | Yes | Runtime to execute in, e.g. 'python3', 'node'; see list_languages for the full catalog | |
| provider | No | Execution backend id to use (see list_execution_providers); default picks automatically | |
| dependencies | No | Packages to install before running, e.g. ['requests==2.31.0']; merged with any PEP 723 block | |
| max_memory_mb | No | Per-call memory ceiling in MiB; 0 means no explicit limit is set | |
| max_output_kb | No | Stdout/stderr capture cap in KiB per stream; 0 uses the 64 KiB default, hard-clamped to 240 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||