diff --git a/vendor/agentos/docs/content/docs/agents/claude.mdx b/vendor/agentos/docs/content/docs/agents/claude.mdx index f8c2d16..4486ab7 100644 --- a/vendor/agentos/docs/content/docs/agents/claude.mdx +++ b/vendor/agentos/docs/content/docs/agents/claude.mdx @@ -4,7 +4,7 @@ description: "Run Claude Code inside an agentOS VM with durable sessions, config skill: false --- -## Quick start +## Quickstart diff --git a/vendor/agentos/docs/content/docs/agents/codex.mdx b/vendor/agentos/docs/content/docs/agents/codex.mdx index 4b9a2f6..a3fce68 100644 --- a/vendor/agentos/docs/content/docs/agents/codex.mdx +++ b/vendor/agentos/docs/content/docs/agents/codex.mdx @@ -5,7 +5,7 @@ description: "Run Codex inside an agentOS VM with durable sessions, configurable skill: false --- -## Quick start +## Quickstart diff --git a/vendor/agentos/docs/content/docs/agents/opencode.mdx b/vendor/agentos/docs/content/docs/agents/opencode.mdx index 7662644..4292c05 100644 --- a/vendor/agentos/docs/content/docs/agents/opencode.mdx +++ b/vendor/agentos/docs/content/docs/agents/opencode.mdx @@ -4,7 +4,7 @@ description: "Run OpenCode inside an agentOS VM with durable sessions, configura skill: false --- -## Quick start +## Quickstart diff --git a/vendor/agentos/docs/content/docs/agents/pi.mdx b/vendor/agentos/docs/content/docs/agents/pi.mdx index c91bed3..aafad71 100644 --- a/vendor/agentos/docs/content/docs/agents/pi.mdx +++ b/vendor/agentos/docs/content/docs/agents/pi.mdx @@ -5,12 +5,12 @@ description: "Run Pi inside an agentOS VM with durable sessions, extensions, cus skill: true --- -## Quick start +## Quickstart - + Read [Sessions](/agentos/docs/sessions) first for session options, streaming events, prompts, and lifecycle management. diff --git a/vendor/agentos/docs/content/docs/architecture/javascript-executor.mdx b/vendor/agentos/docs/content/docs/architecture/javascript-executor.mdx index 53d36df..42232d9 100644 --- a/vendor/agentos/docs/content/docs/architecture/javascript-executor.mdx +++ b/vendor/agentos/docs/content/docs/architecture/javascript-executor.mdx @@ -39,8 +39,9 @@ Guest V8 execution is deliberately different: the only non-V8 platform thread that enters that isolate. - Synchronous guest JavaScript or a synchronous bridge wait can block that executor, but cannot occupy a Tokio worker or another VM's executor. -- The number of active and warm executor threads is bounded separately from - socket and task counts. +- Operators can cap active executor threads separately from socket and task + counts with `runtime.executor.maxActiveVms`. Executor admission is uncapped + by default and is not derived from the sidecar's reported CPU count. There is therefore no "Tokio task running a Node.js process." Trusted I/O runs as Tokio tasks; untrusted JavaScript runs on a V8 executor thread. diff --git a/vendor/agentos/docs/content/docs/resource-limits.mdx b/vendor/agentos/docs/content/docs/resource-limits.mdx index 9646c97..c7f8ec2 100644 --- a/vendor/agentos/docs/content/docs/resource-limits.mdx +++ b/vendor/agentos/docs/content/docs/resource-limits.mdx @@ -15,6 +15,11 @@ Every agentOS VM runs with **per-VM resource and runtime caps**. These caps cont Set caps on the `limits` object in the `agentOS` config. Limits are grouped by subsystem (`resources`, `process`, `jsRuntime`, `python`, `wasm`, and more). Omitted limits keep their secure default. +V8 executor admission is process-wide rather than per-VM. It is uncapped by +default and does not derive a ceiling from the sidecar's reported CPU count. +Operators can set `runtime.executor.maxActiveVms` when creating a sidecar to +enforce an explicit concurrent-executor ceiling. + ## Available caps @@ -23,7 +28,7 @@ Set caps on the `limits` object in the `agentOS` config. Limits are grouped by s |---|---|---| | `resources.maxProcesses` | Concurrent processes in the VM process table | Caps fork bombs and runaway spawning. New spawns fail with `EAGAIN`. | | `resources.maxOpenFds` | Open file descriptors | Exhausting the table fails with `EMFILE` / `ENFILE`. | -| `resources.maxSockets` | Open sockets in the socket table | Bounds concurrent connections; excess `connect`/`accept` fail. | +| `resources.maxSockets` | Open sockets in the socket table | Default is `256`. This includes guest sockets and the sidecar-owned sockets used to send host requests into VM services. Excess socket operations fail instead of consuming more host resources. | | `resources.maxFilesystemBytes` | Total bytes stored in the virtual filesystem | Bounds VFS storage; writes past the budget fail with a no-space error. | | `resources.maxInodeCount` | Inodes retained by the virtual filesystem | Default is `16384`; creating another file or directory fails with a no-space error. This is the expected upper bound for filesystem-schema sizing and benchmarks. | | `resources.maxWasmFuel` | WASM execution budget | Bounds WASM execution work; unset means no explicit fuel budget. | @@ -53,6 +58,19 @@ Set caps on the `limits` object in the `agentOS` config. Limits are grouped by s | `process.maxSpawnFileActions` | File actions decoded for one `posix_spawn` call | Default is `4096`; excess actions fail with `E2BIG`. | | `process.maxSpawnFileActionBytes` | Serialized file-action bytes for one `posix_spawn` call | Default is `1 MiB`; excess input fails with `E2BIG`. | +### Streaming fetch responses + +A VM may have at most `256` host-to-VM streaming HTTP responses open at once. +This is a fixed runtime limit and does not have a `limits` configuration field. +A stream occupies one slot after `fetchStreamStart()` returns and releases it +when `fetchStreamRead()` reports `done: true` or the host calls +`fetchStreamCancel()`. Opening another stream at the limit fails with +`ERR_AGENTOS_VM_FETCH_STREAM_LIMIT`. + +This limit bounds concurrent streams, not the number of requests a warm VM can +serve over its lifetime. Completed and cancelled streams do not accumulate +toward the limit. + ## Behavior at the limit - **WASM stack**: deep recursion throws a stack-overflow error in the guest, never a host crash. diff --git a/vendor/agentos/examples/claude/client.ts b/vendor/agentos/examples/claude/client.ts index 4467e5b..76c0973 100644 --- a/vendor/agentos/examples/claude/client.ts +++ b/vendor/agentos/examples/claude/client.ts @@ -6,7 +6,7 @@ const client = createClient({ }); const agent = client.vm.getOrCreate("my-agent"); -// ── Quick start ─────────────────────────────────────────────────── +// ── Quickstart ──────────────────────────────────────────────────── async function quickStart() { // docs:start quickstart await agent.sessions.open({ diff --git a/vendor/agentos/examples/codex/client.ts b/vendor/agentos/examples/codex/client.ts index 1a827c5..6143777 100644 --- a/vendor/agentos/examples/codex/client.ts +++ b/vendor/agentos/examples/codex/client.ts @@ -7,7 +7,7 @@ const client = createClient({ }); const agent = client.vm.getOrCreate("my-agent"); -// ── Quick start ─────────────────────────────────────────────────── +// ── Quickstart ──────────────────────────────────────────────────── async function quickStart() { await agent.sessions.open({ agent: "codex", diff --git a/vendor/agentos/examples/embedded/limits.ts b/vendor/agentos/examples/embedded/limits.ts index 14c19c3..da2fe4c 100644 --- a/vendor/agentos/examples/embedded/limits.ts +++ b/vendor/agentos/examples/embedded/limits.ts @@ -1,8 +1,13 @@ import { AgentOs } from "@rivet-dev/agentos-core"; +const sidecar = await AgentOs.createSidecar({ + runtime: { executor: { maxActiveVms: 8 } }, +}); + // The same `limits` object the actor takes. `onLimitWarning` is an embedded // create option rather than a broadcast event, so it fires only in this process. const vm = await AgentOs.create({ + sidecar: { kind: "explicit", handle: sidecar }, limits: { resources: { maxProcesses: 64, maxFilesystemBytes: 256 * 1024 * 1024 }, jsRuntime: { v8HeapLimitMb: 128, cpuTimeLimitMs: 30_000 }, @@ -12,3 +17,4 @@ const vm = await AgentOs.create({ }, }); await vm.dispose(); +await sidecar.dispose(); diff --git a/vendor/agentos/examples/opencode/client.ts b/vendor/agentos/examples/opencode/client.ts index 450b768..a3751ad 100644 --- a/vendor/agentos/examples/opencode/client.ts +++ b/vendor/agentos/examples/opencode/client.ts @@ -6,7 +6,7 @@ const client = createClient({ }); const agent = client.vm.getOrCreate("my-agent"); -// ── Quick start ─────────────────────────────────────────────────── +// ── Quickstart ──────────────────────────────────────────────────── async function quickStart() { // docs:start quickstart await agent.sessions.open({ diff --git a/vendor/agentos/examples/pi/README.md b/vendor/agentos/examples/pi/README.md index 2c01c77..21f8556 100644 --- a/vendor/agentos/examples/pi/README.md +++ b/vendor/agentos/examples/pi/README.md @@ -1,11 +1,11 @@ --- title: "Pi Agent" -description: "Run the Pi coding agent in a session, including quick start and session management." +description: "Run the Pi coding agent in a session, including quickstart and session management." category: "Agents" order: 1 --- -Spin up the Pi coding agent inside a VM, open a session, and send it prompts. Reach for this when you want an end-to-end agent loop — quick start plus the session knobs for skills and MCP servers. +Spin up the Pi coding agent inside a VM, open a session, and send it prompts. Reach for this when you want an end-to-end agent loop from quickstart through the session knobs for skills and MCP servers. ## How it works diff --git a/vendor/agentos/examples/pi/client.ts b/vendor/agentos/examples/pi/client.ts index 9d33559..32eea59 100644 --- a/vendor/agentos/examples/pi/client.ts +++ b/vendor/agentos/examples/pi/client.ts @@ -6,8 +6,8 @@ const client = createClient({ }); const agent = client.vm.getOrCreate("my-agent"); -// ── Quick start ─────────────────────────────────────────────────── -// docs:start quick-start +// ── Quickstart ──────────────────────────────────────────────────── +// docs:start quickstart async function quickStart() { await agent.sessions.open({ agent: "pi", @@ -21,7 +21,7 @@ async function quickStart() { }); console.log(result.message?.content ?? []); } -// docs:end quick-start +// docs:end quickstart // ── Skills ──────────────────────────────────────────────────────── // diff --git a/vendor/agentos/examples/quickstart/sandbox/index.ts b/vendor/agentos/examples/quickstart/sandbox/index.ts index cb93c6d..6bcb32a 100644 --- a/vendor/agentos/examples/quickstart/sandbox/index.ts +++ b/vendor/agentos/examples/quickstart/sandbox/index.ts @@ -39,10 +39,10 @@ try { const runCommandResult = await vm.process.exec( "agentos-sandbox run-command --command echo --args 'hello from Docker sandbox'", ); - console.log("Sandbox command:", runCommandResult.stdout.trim()); + console.log("Sandbox command:", (runCommandResult.stdout ?? "").trim()); const processList = await vm.process.exec("agentos-sandbox list-processes"); - console.log("Sandbox processes:", processList.stdout.trim()); + console.log("Sandbox processes:", (processList.stdout ?? "").trim()); const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY; if (ANTHROPIC_API_KEY) { diff --git a/vendor/agentos/examples/workflows/server.ts b/vendor/agentos/examples/workflows/server.ts index 5fd75de..fb15231 100644 --- a/vendor/agentos/examples/workflows/server.ts +++ b/vendor/agentos/examples/workflows/server.ts @@ -67,7 +67,7 @@ async function runTests( ): Promise { const agent = step.client().vm.getOrCreate("bug-fixer"); const tests = await agent.process.exec("cd /home/agentos/repo && npm test"); - return tests.exitCode; + return tests.exitCode ?? 1; } // docs:end basic