The runtime model
Your agent function describes the next step
The default export is a synchronous function. It reads the current input, selects resources with hooks, and returns instructions:The harness performs the loop
OpenComputer owns the agent harness. For each step it:- renders the agent function;
- builds a model request from the returned instructions and selected resources;
- streams the model response;
- validates and executes requested tools;
- records the resulting events; and
- renders again when another model step is required.
A session makes execution durable
A session stores the conversation and runtime events across turns. Clients can disconnect, reconnect, and continue without reconstructing the agent’s history themselves. Every session remains pinned to the immutable deployment it started with. A new development sync or production deployment affects new sessions, not code already running inside an existing session. Memory is what outlives a session: project-scoped documents that the agent function reads at render withuseMemory, that the model saves
through memory tools, and that the owner reads, edits and exports.
Capabilities are selected, not executed, during render
Use the narrowest capability that fits the work:
The model decides whether to request an available tool. The harness remains
responsible for validating the request, executing it, and recording the
result. See Agent capabilities for the full comparison.
Deployment registers; rendering selects
A deployment packages the agents and resources that are allowed to exist. A render selects the tools, instructions and other resources for one model step. Managed GitHub access is session-wide: its token carries the deployment’s declared GitHub permissions. ConditionaluseConnection() calls do not change that token’s authority.
Development and Production point to different deployments and keep operational
configuration—such as secrets, schedule state, and webhook tokens—separate.
Read
Deployments and environments for that lifecycle.
Remember this
The agent function decides what the agent is for this step.
The harness decides how to run that step.
The session remembers what happened.
Explore each concept
Reactive agents
Define instructions and select resources with ordinary TypeScript.
Sessions and turns
Understand durable conversations and runtime events.
Capabilities
Choose between tools, MCP servers, and skills.
Schedules
Start recurring sessions from code-defined cron schedules.
Webhooks
Start sessions from authenticated external services.
Database
Store application state and durable work for application-owned workers.