This skill should be used when the user asks "what is agent-runtime", "why use agent-runtime", "what does this repo do", "agent runtime architecture", "how does agent-runtime work", or needs to...
Agent Runtime is a general-purpose platform for launching arbitrary AI agent workloads on demand. It orchestrates AI agents (Claude via Agent SDK, OpenCode) in isolated Modal sandboxes, providing a Node.js backend runtime and React client library for building applications with AI agents.
Key principle: The runtime handles session management and agent orchestration - it does not enforce any data schema on the calling application. Data types are passed back to the app, which decides what to do with them.
The monorepo provides two packages:
| Package | Purpose |
|---|---|
@hhopkins/agent-runtime |
Node.js backend runtime for orchestrating agents in Modal sandboxes |
@hhopkins/agent-runtime-react |
React hooks and context for connecting to the runtime |
Agents execute in Modal sandboxes, not on the application server. This provides:
Real-time block-by-block streaming of agent output via WebSocket:
block_start - New block beginstext_delta - Incremental text updatesblock_update - Block metadata changesblock_complete - Block finishesBuilt-in session lifecycle with:
Supports multiple agent architectures:
Configure via AGENT_ARCHITECTURE_TYPE when creating sessions.
First-class React integration with hooks for:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Application β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β AgentServiceProvider (React) β β
β β ββββββββββββββββ ββββββββββββββββ βββββββββββββ β β
β β βuseAgentSessionβ β useMessages β βuseFiles β β β
β β ββββββββββββββββ ββββββββββββββββ βββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REST API β WebSocket
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend Runtime β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SessionManager β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β AgentSession β β β
β β β - Sandbox lifecycle β β β
β β β - Transcript parsing β β β
β β β - File watching β β β
β β β - Periodic sync β β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββ β
β β PersistenceAdapter β β
β β (Implemented by your application) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Modal Sandbox β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Agent (Claude SDK or OpenCode) β β
β β - Tools (Read, Write, Edit, Bash, Grep, Glob) β β
β β - Skills β β
β β - Subagents β β
β β - MCP Servers β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A session represents a single agent conversation. Sessions are:
Agent output is parsed into typed blocks for rendering:
UserMessageBlock - User inputAssistantTextBlock - Agent text responseToolUseBlock - Tool invocationToolResultBlock - Tool outputThinkingBlock - Agent reasoning (if exposed)SystemBlock - System messagesSubagentBlock - Subagent invocationErrorBlock - Error informationConfiguration defining agent capabilities:
The main integration point between the runtime and application storage. Applications implement this interface to:
Good fit:
Consider alternatives if: