Why Long-Running Agent Processes Need a Resident Process Model Not a Function Invocation Model
Persistent identity and durable state let agents survive waits without paying for idle compute.

Long-running agents need persistent AI agent infrastructure rather than a stateless function invocation model because their work depends on state that survives calls, waits, and session boundaries. A resident process model preserves that continuity through persistent identity, durable state, and checkpointed execution. Sleep-and-restore scheduling lets it do this without a bill for idle compute.
How agents actually work across time — and why that matters for infrastructure
An agent clones a repository, installs dependencies, modifies files, and runs tests. It then waits for CI to finish before resuming implementation and verification. The task may span hours, running in the background while a developer does other work. Its environment is part of its progress. The next action depends not only on the latest instruction but also on installed packages, intermediate artifacts, tool results, and decisions made earlier.
AstronOS defines “long-horizon” work through state dependence across steps. That dependence can cross sessions, models, people, tools, and execution environments. The work item outlives any single conversation. Responsibility may change hands, or new evidence may invalidate an earlier decision, without creating a new task. Infrastructure therefore needs to preserve the continuity of the work.
This changes the unit that execution infrastructure must support. A quick exchange fits within a short-lived invocation, but a background task has times when it runs and long waits in between. The work goes on after the interaction ends. Treating those two boundaries as equivalent makes the application responsible for rebuilding continuity whenever execution resumes.
What are the limitations of running long-running agents on serverless functions?
The function invocation model assumes statelessness between calls, short windows in which to run, and a process identity that can be thrown away. These assumptions fit request/response workloads whose durable state can be externalized before the function returns. The model’s fit weakens when the state needed for the next action includes an execution environment rather than only a small, structured record.
For an agent, that environment can include open file handles, installed packages, partial writes, in-memory reasoning context, and pending tool continuations. These do not map cleanly onto a key-value store. Likewise, execution limits built for short interactions leave too little time to wait for human approval, slow external APIs, or CI to finish. The invocation cannot simply remain open indefinitely. A task that moves through analysis, planning, implementation, and verification needs a lifecycle distinct from the request that started it.
Disposable identity creates a further discontinuity because successive invocations can run on different workers. The model provides no persistent process that owns its filesystem, kernel state, or network socket across those calls. An installed dependency or open browser session therefore cannot be assumed to follow the task.
Serialization is a possible workaround, but not a free one. The application must externalize the needed state and reconstruct the environment on the next invocation. That burden compounds as each step requires more source material to be re-read and more earlier decisions to be interpreted. Longer context does not remove the need to determine which decisions remain authoritative.
The three failure modes that follow directly from the mismatch
AstronOS found that runtime-mediated handoff passed its benchmark scorer in nearly every run of three-stage tasks, while the naive re-read strategy passed none. The comparison exposes a continuity problem. Re-reading source material and replaying history were less effective than maintaining versioned authoritative state. Reconstruction lost the signal that earlier statements had been superseded. This is evidence about state handoff, rather than a benchmark of any particular serverless platform.
The first operational failure is state loss on crash or timeout. A forced termination can discard partially completed work, uncommitted tool results, and files that exist only in the disposable environment. Only externalized progress has a durable recovery path. The function model leaves the application developer responsible for deciding what to save, when to save it, and how to restore a coherent task.
The second failure is cost distortion when the workaround is to keep a full process running throughout the task. Agents wait for tool responses, approvals, and timers, yet continuously provisioned compute remains billable during those waits. Moving idle state into durable snapshots changes that expense into storage cost.
The third failure is context degradation across reconstructed sessions. Even a complete history leaves the model to infer which prior messages and tool records still govern the task. Summarization and memory retrieval can reduce the volume. Neither alone defines authoritative task state or establishes when a new result becomes committed state, so a recovered conversation can still represent the wrong version of the work.
What the resident process model actually is, and how it resolves each failure mode
A resident process model gives each agent a persistent identity associated with its own process, filesystem, and kernel state. That identity survives steps, sleeps, and session boundaries. Residency means the execution environment can be checkpointed and restored without treating every resumption as a fresh worker reconstructing an unfamiliar task.
The model also needs clear rules for authoritative task state. AstronOS gives each step scoped input from one state version along with any new material. A result advances state only after validation passes and the update is successfully recorded as a new version. Authority is therefore a runtime responsibility. The next step reads the accepted state directly instead of guessing which parts of a transcript remain valid.
Durable commits and snapshots address different parts of recovery. Versioned commits preserve accepted progress, while snapshots preserve execution state across sleep and restoration. Under this commit discipline, recovery need not discard the whole task when an uncommitted step fails. It can return to the durable boundary. By contrast, a disposable invocation retains only what the application has explicitly externalized.
When the agent becomes idle, the runtime snapshots its execution state to durable storage and terminates the running process. Compute charges stop during the wait. The next signal restores the snapshot, preserving process continuity.
Why micro-VM isolation is the right substrate for a resident agent process
The execution environment must support more than persistence. An agent may install unvetted packages, run arbitrary binaries, or execute code from external sources, so its workload must be treated as potentially hostile. Isolation is a security requirement. A suitable substrate also needs fast boot, low overhead, and snapshot support while giving the agent a real environment for packages, browsers, and tools.
A container shares a kernel with its host and neighboring containers. That shared boundary creates a risk when untrusted code exploits the kernel. A micro-VM instead places the workload behind its own guest kernel and hardware virtualization through KVM. The isolation boundary is stronger than a shared container namespace. For untrusted agent code, micro-VMs such as Firecracker or hardened runtimes such as gVisor are the relevant alternatives to ordinary Docker isolation.
Firecracker has a sub-125ms boot time, very little memory overhead per VM, guest CPU performance close to bare metal, and support for snapshot/restore. The last property connects isolation to economics. An idle execution environment can become a stored snapshot rather than a running VM, giving the scheduler a primitive for preserving identity without reserving active compute.
Vercel Sandbox reached general availability on January 30, 2026. It is built on Hive, Vercel’s internal platform for orchestrating Firecracker microVM clusters across regions, and targets work including repository cloning, dependency installation, and testing. Deno Sandbox launched in beta on February 3, 2026, with each sandbox running in a dedicated Firecracker microVM on Deno Deploy’s infrastructure. The shared substrate is the significant architectural convergence. These implementations connect isolated agent execution to the same micro-VM foundation without making the services interchangeable.
How the sleep-and-restore scheduler makes per-agent economics work at scale
In a sleep-and-restore model, storage cost depends on snapshot size and sleep duration, while compute cost depends on active execution time. Most agents are idle most of the time. For an agent active during only a small fraction of each day, storage dominates its idle cost.
The scheduler makes that cost model concrete. When the inbound queue is empty and the agent is waiting for a tool response, approval, or timer, the harness snapshots the execution state to durable storage. It then terminates the process, stopping compute billing. When the trigger arrives, the harness restores the snapshot in a sub-second operation and resumes execution where it paused.
This changes the commercial meaning of one persistent environment per user. Fleet compute cost follows active minutes rather than the capacity that would be needed to keep every environment running. The process keeps its identity between those times when it is active. This pattern fits agencies that sell one embedded agent per client for a recurring fee because each client’s workflow needs to carry on between runs without running all the time.
Anthropic’s Claude Managed Agents charges standard token rates plus a per active session-hour fee, with no charge for idle sessions. That pricing distinguishes active execution from mere session residency. It is a commercial expression of the same active/idle distinction. The scheduler supplies the infrastructure mechanism that makes such a distinction practical for persistent agent fleets.
What a resident process gives agents that function invocation never can — real autonomy
Agent autonomy requires an environment that persists across decisions. Installing packages, modifying files, opening browser sessions, and running binaries all change the conditions under which the next action occurs. Those changes are part of the work. A stateless invocation cannot itself preserve them after termination, so continuity must come from a persistent layer outside the invocation.
A resident micro-VM gives the agent room to alter, break, and rebuild its environment within an isolation boundary. This connects freedom of action to containment. The agent can use the same environment for its next step, while the virtualization boundary keeps neighboring workloads apart.
That boundary does not replace layered defense. Input sanitization, static code validation, pre-execution checks, isolated execution, runtime monitoring, and post-execution review still have roles. A stable process identity makes those controls easier to apply across the task. Tool and agent coordination also benefits, including MCP access and A2A handoffs, because persistent execution can retain connections and authenticated sessions across steps.
AstronOS places continuity at the work-item level even when conversations end, responsibility changes, or later evidence overturns an earlier assumption. The runtime must maintain that continuity. This is the prerequisite for sustained autonomous work. A resident process is not merely a faster deployment choice but the foundation for an agent whose actions accumulate into a durable task.
Building on a resident process infrastructure — what to look for and how it fits together
For a team choosing infrastructure, the lesson is to evaluate lifecycle guarantees as well as the presence of a sandbox. Persistent disk and filesystem state should keep installed packages, credentials, and intermediate artifacts in place through sleep and redeploy. Kernel state must be part of the agent’s persistent environment. Rebuilding from a base image at each boundary does not provide the same continuity.
Isolation and restoration need equally explicit requirements. Each agent should have a real isolation boundary suitable for untrusted execution. Sub-second wake latency keeps restoration from adding perceptible delay to interactive workflows. Automatic snapshot/restore scheduling should handle the lifecycle without requiring the application team to build its own scheduler, and pricing should follow active compute and idle storage.
The complete product then combines three distinct layers. A persistent micro-VM per user supplies execution, MCP or A2A supplies tool and agent coordination, and a single-push path from code to a live API endpoint supplies the deployment workflow. These layers solve different problems. A protocol cannot keep kernel state in place, and a fast deployment path cannot set the authoritative task state.
Assembling this model from a VM provider, snapshot tool, scheduler, and isolation layer is technically possible. It also places responsibility for the entire runtime on the application developer. The infrastructure decision turns on whether continuity, recovery, and idle scheduling are supplied by the platform or remain work the agent product team must implement.


