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
36 changes: 36 additions & 0 deletions docs/onecomputer/claude-agent-sdk-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Claude Agent SDK runtime requirement

ONEComputer sandboxes are used by ONEVibe as the execution boundary for
Claude agents. Claude Code CLI availability is not sufficient for this
contract: the sandbox must also contain the Claude Agent SDK so a Node worker
can call `query()` directly and stream native SDK messages into ONEVibe's
durable journal/SSE projection.

The Kasm bootstrap installs the pinned runtime dependency:

```text
@anthropic-ai/claude-agent-sdk@0.3.210
```

Bootstrap must fail closed unless both checks pass:

```sh
claude --version
NODE_PATH=/home/kasm-user/.npm-global/lib/node_modules node -e "const {createRequire}=require('node:module'); createRequire(process.cwd() + '/.onevibe-agent-sdk.mjs').resolve('@anthropic-ai/claude-agent-sdk')"
```

The package is installed as an image/bootstrap dependency alongside
`@anthropic-ai/claude-code`, `pptxgenjs`, and `pdf-lib`; it must not be
installed by an agent during a user task. A sandbox is not `bootstrapped` until
the SDK module check succeeds. This keeps model execution deterministic and
prevents a task from silently switching to a CLI-only runtime.

ONEVibe transfers the worker source into the conversation workspace and
executes it with Node 22. The worker owns the SDK query, session persistence,
LiteLLM environment, bounded tool list, and raw journal. ONEComputer remains
the provider/control boundary; the web browser receives only server-projected
events and never receives the sandbox process, credential, X11, or VNC handle.

The corresponding ONEVibe proof is documented in
`onevibe/docs/ONECOMPUTER-CLAUDE-AGENT-SDK.md`. A fresh Azure deployment must
be run before claiming the combined SDK + visual + SSE gate.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async function installClaudeDesktopAndCode(id: string): Promise<ExecResult> {

return execInSandbox(
id,
"set -e; export PATH=/opt/node22/bin:/home/kasm-user/.npm-global/bin:$PATH; npm install -g @anthropic-ai/claude-code --prefix /home/kasm-user/.npm-global; grep -q npm-global /home/kasm-user/.bashrc || echo 'export PATH=/opt/node22/bin:/home/kasm-user/.npm-global/bin:$PATH' >> /home/kasm-user/.bashrc; claude --version",
"set -e; export PATH=/opt/node22/bin:/home/kasm-user/.npm-global/bin:$PATH; npm install -g @anthropic-ai/claude-code @anthropic-ai/claude-agent-sdk@0.3.210 pptxgenjs pdf-lib --prefix /home/kasm-user/.npm-global; grep -q npm-global /home/kasm-user/.bashrc || echo 'export PATH=/opt/node22/bin:/home/kasm-user/.npm-global/bin:$PATH' >> /home/kasm-user/.bashrc; claude --version; NODE_PATH=/home/kasm-user/.npm-global/lib/node_modules node -e \"require('pptxgenjs'); require('pdf-lib'); const {createRequire}=require('node:module'); createRequire(process.cwd() + '/.onevibe-agent-sdk.mjs').resolve('@anthropic-ai/claude-agent-sdk')\"",
);
}

Expand Down
Loading