Skip to content
Open
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
2 changes: 1 addition & 1 deletion vendor/agentos/docs/content/docs/agents/claude.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Run Claude Code inside an agentOS VM with durable sessions, config
skill: false
---

## Quick start
## Quickstart

<CodeGroup>
<CodeSnippet file="examples/claude/server.ts" />
Expand Down
2 changes: 1 addition & 1 deletion vendor/agentos/docs/content/docs/agents/codex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Run Codex inside an agentOS VM with durable sessions, configurable
skill: false
---

## Quick start
## Quickstart

<CodeGroup>
<CodeSnippet file="examples/codex/server.ts" title="server.ts" />
Expand Down
2 changes: 1 addition & 1 deletion vendor/agentos/docs/content/docs/agents/opencode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Run OpenCode inside an agentOS VM with durable sessions, configura
skill: false
---

## Quick start
## Quickstart

<CodeGroup>
<CodeSnippet file="examples/opencode/server.ts" />
Expand Down
4 changes: 2 additions & 2 deletions vendor/agentos/docs/content/docs/agents/pi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: "Run Pi inside an agentOS VM with durable sessions, extensions, cus
skill: true
---

## Quick start
## Quickstart

<CodeGroup>
<CodeSnippet file="examples/pi/server.ts" />

<CodeSnippet file="examples/pi/client.ts" region="quick-start" />
<CodeSnippet file="examples/pi/client.ts" region="quickstart" />
</CodeGroup>

Read [Sessions](/agentos/docs/sessions) first for session options, streaming events, prompts, and lifecycle management.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 19 additions & 1 deletion vendor/agentos/docs/content/docs/resource-limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<CodeSnippet file="examples/resource-limits/server.ts" />

## Available caps
Expand All @@ -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. |
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion vendor/agentos/examples/claude/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const client = createClient<typeof registry>({
});
const agent = client.vm.getOrCreate("my-agent");

// ── Quick start ───────────────────────────────────────────────────
// ── Quickstart ────────────────────────────────────────────────────
async function quickStart() {
// docs:start quickstart
await agent.sessions.open({
Expand Down
2 changes: 1 addition & 1 deletion vendor/agentos/examples/codex/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const client = createClient<typeof registry>({
});
const agent = client.vm.getOrCreate("my-agent");

// ── Quick start ───────────────────────────────────────────────────
// ── Quickstart ────────────────────────────────────────────────────
async function quickStart() {
await agent.sessions.open({
agent: "codex",
Expand Down
6 changes: 6 additions & 0 deletions vendor/agentos/examples/embedded/limits.ts
Original file line number Diff line number Diff line change
@@ -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 },
Expand All @@ -12,3 +17,4 @@ const vm = await AgentOs.create({
},
});
await vm.dispose();
await sidecar.dispose();
2 changes: 1 addition & 1 deletion vendor/agentos/examples/opencode/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const client = createClient<typeof registry>({
});
const agent = client.vm.getOrCreate("my-agent");

// ── Quick start ───────────────────────────────────────────────────
// ── Quickstart ────────────────────────────────────────────────────
async function quickStart() {
// docs:start quickstart
await agent.sessions.open({
Expand Down
4 changes: 2 additions & 2 deletions vendor/agentos/examples/pi/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions vendor/agentos/examples/pi/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const client = createClient<typeof registry>({
});
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",
Expand All @@ -21,7 +21,7 @@ async function quickStart() {
});
console.log(result.message?.content ?? []);
}
// docs:end quick-start
// docs:end quickstart

// ── Skills ────────────────────────────────────────────────────────
//
Expand Down
4 changes: 2 additions & 2 deletions vendor/agentos/examples/quickstart/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion vendor/agentos/examples/workflows/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function runTests(
): Promise<number> {
const agent = step.client<typeof registry>().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

Expand Down
Loading