An AI agent that resolves GitHub issues in an OpenComputer sandbox with live resource scaling. The sandbox starts small, scales up for heavy compilation, and scales back down — paying for peak resources only when needed.
- You comment
@myagent resolve thison a GitHub issue - A webhook triggers the API, which spins up an OpenComputer sandbox
- An AI agent (Claude) clones the repo, reads the issue, investigates, and makes a fix
- The agent detects the sandbox has limited memory, scales up to 8 GB via the metadata service
- Builds the Rust project, scales back down to baseline
- Runs tests, commits, pushes a branch, opens a PR, and comments on the issue
The whole flow takes ~2 minutes and costs ~$0.30 in API calls.
GitHub Issue → Webhook → API (Hono) → OpenComputer Sandbox
├── Agent (Claude Agent SDK)
├── scales 896 MB → 8 GB → 2 GB
└── clone → fix → build → test → PR
Three components:
| Component | What | Tech |
|---|---|---|
ingest-rs/ |
Rust data pipeline — the project the agent fixes | axum, serde, tokio, reqwest |
agent/ |
AI agent that resolves issues | @anthropic-ai/claude-agent-sdk |
api/ |
Webhook handler that launches sandboxes | Hono, @opencomputer/sdk, @octokit |
- Node.js 20+
- An OpenComputer API key
- An Anthropic API key
- A GitHub PAT with
reposcope - ngrok or similar for webhook delivery
cd agent && npm install
cd ../api && npm install# agent/.env
ANTHROPIC_API_KEY=sk-ant-...
GITHUB_TOKEN=ghp_...
OPENCOMPUTER_API_KEY=osb_...
OPENCOMPUTER_API_URL=https://app.opencomputer.dev
# api/.env
OPENCOMPUTER_API_KEY=osb_...
OPENCOMPUTER_API_URL=https://app.opencomputer.dev
GITHUB_TOKEN=ghp_...
GITHUB_WEBHOOK_SECRET=your-webhook-secret
ANTHROPIC_API_KEY=sk-ant-...
CHECKPOINT_ID= # filled in after deploy
PORT=3000This creates an OpenComputer checkpoint with Rust, Node.js, gh CLI, Claude Code, and the agent code:
cd agent
npx tsx scripts/deploy-manual.tsCopy the checkpoint ID from the output and set it as CHECKPOINT_ID in api/.env.
On your repo, add a webhook:
- URL:
https://<your-ngrok-url>/webhooks/github - Content type:
application/json - Secret: same as
GITHUB_WEBHOOK_SECRET - Events: Issue comments only
# Terminal 1 — API server
cd api && npm run dev
# Terminal 2 — expose to internet
ngrok http 3000Then comment @myagent resolve this on an issue.
The sandbox starts with ~896 MB of memory. The agent:
- Checks current resources:
curl http://169.254.169.254/v1/limits - Scales up:
curl -X POST http://169.254.169.254/v1/scale -d '{"memoryMB": 8192}' - Builds the Rust project (needs the extra memory for compilation)
- Scales back down:
curl -X POST http://169.254.169.254/v1/scale -d '{"memoryMB": 2048}' - Runs tests at lower memory (no recompilation needed)
The scaling happens live — no reboot, no checkpoint-restore. The VM's memory limit changes in-place via cgroup updates.
When you change agent code or prompt:
cd agent
npx tsx scripts/deploy-manual.ts
# Update CHECKPOINT_ID in api/.env with the new ID
# Restart api/The agent can run outside a sandbox:
cd agent
npm run dev -- --repo diggerhq/demo-elasticity --issue 1The elasticity API calls will 404 (no metadata service) but the build will work if your machine has enough RAM.