Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description = "Native execution plane scaffold for Agent OS"

[dependencies]
agent-os-bridge = { path = "../bridge" }
nix = { version = "0.29", features = ["fs"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"

Expand Down
31 changes: 31 additions & 0 deletions crates/execution/assets/pyodide/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Pyodide runtime bundle for the Agent OS Python sidecar.

Bundled runtime files:
- `pyodide.mjs`
- `pyodide.asm.js`
- `pyodide.asm.wasm`
- `pyodide-lock.json`
- `python_stdlib.zip`

Bundled offline package wheels:
- `numpy-2.2.5-cp313-cp313-pyodide_2025_0_wasm32.whl`
- `pandas-2.3.3-cp313-cp313-pyodide_2025_0_wasm32.whl`
- `python_dateutil-2.9.0.post0-py2.py3-none-any.whl`
- `pytz-2025.2-py2.py3-none-any.whl`
- `six-1.17.0-py2.py3-none-any.whl`

Bundle size as vendored in this directory:
- Core Pyodide runtime: 12,283,621 bytes
- Offline package wheels: 8,347,517 bytes
- Total: 20,631,138 bytes (19.68 MiB)

`python-runner.mjs` points both `indexURL` and `packageBaseUrl` at this local directory so `pyodide.loadPackage()` stays offline and never falls back to the CDN for the preloaded packages.

Debug timing output:
- Set `AGENT_OS_PYTHON_WARMUP_DEBUG=1` on a Python execution request to emit `__AGENT_OS_PYTHON_WARMUP_METRICS__:` JSON lines on stderr.
- The Rust execution engine emits a `phase:"prewarm"` line that reports whether warmup executed or reused the cached compile-cache path, plus the measured warmup duration in milliseconds.
- `python-runner.mjs` emits a `phase:"startup"` line just before guest code runs, including total startup time, `loadPyodide()` time, package-load time, package count, and whether the source was inline code, a file, or prewarm-only.

Startup targets:
- Cold start target: first request in a fresh cache should keep the combined prewarm plus startup path under `3000ms` on commodity hardware.
- Warm start target: cached follow-up requests should keep the `phase:"startup"` time under `500ms`.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions crates/execution/assets/pyodide/pyodide-lock.json

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions crates/execution/assets/pyodide/pyodide.asm.js

Large diffs are not rendered by default.

Binary file added crates/execution/assets/pyodide/pyodide.asm.wasm
Binary file not shown.
4 changes: 4 additions & 0 deletions crates/execution/assets/pyodide/pyodide.mjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file added crates/execution/assets/pyodide/python_stdlib.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions crates/execution/src/javascript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ impl JavascriptExecutionEngine {
child,
stdout_reader,
stderr_reader,
true,
sender,
JavascriptExecutionEvent::Exited,
|message| JavascriptExecutionEvent::Stderr(message.into_bytes()),
Expand Down Expand Up @@ -507,6 +508,7 @@ fn configure_node_sandbox(
&request.cwd,
&read_paths,
&write_paths,
true,
false,
env_builtin_enabled(&request.env, "child_process"),
);
Expand Down
7 changes: 7 additions & 0 deletions crates/execution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ mod node_process;

pub mod benchmark;
pub mod javascript;
pub mod python;
pub mod wasm;

pub use agent_os_bridge::GuestRuntime;
Expand All @@ -16,6 +17,12 @@ pub use javascript::{
JavascriptExecutionEngine, JavascriptExecutionError, JavascriptExecutionEvent,
JavascriptExecutionResult, StartJavascriptExecutionRequest,
};
pub use python::{
CreatePythonContextRequest, PythonContext, PythonExecution, PythonExecutionEngine,
PythonExecutionError, PythonExecutionEvent, PythonExecutionResult, PythonVfsRpcMethod,
PythonVfsRpcRequest, PythonVfsRpcResponsePayload, PythonVfsRpcStat,
StartPythonExecutionRequest,
};
pub use wasm::{
CreateWasmContextRequest, StartWasmExecutionRequest, WasmContext, WasmExecution,
WasmExecutionEngine, WasmExecutionError, WasmExecutionEvent, WasmExecutionResult,
Expand Down
Loading
Loading