Replacing Shared CI Runners With Per-Task VM Dispatch for Cursor and OpenCode Workloads
Isolated VMs eliminate environment pollution between agent tasks.

Isolated VM environments for cloud coding agents give each task a fresh filesystem, execution environment, and kernel boundary, then discard that environment when the task ends. Replacing shared CI runners with per-task VM dispatch keeps Cursor and OpenCode workloads from inheriting one another’s changes. The governing principle is to separate centralized orchestration from isolated execution, rather than make a shared machine safe for an open-ended agent loop.
Why shared CI runners are the wrong foundation for coding agents
Shared CI runners are persistent pools of machines that jobs share in rotation. They are optimized for short-lived, idempotent scripts, with the assumption that machine state between runs will not affect the result. An agent clones a repository, installs packages, writes code, runs tests, reads errors, and tries again. Each step can change the environment on which the next step depends.
Those changes extend beyond the source files. An agent may open a port, alter package manager state, or spawn a subprocess that outlives its session. A failed test can prompt another installation or a partial reversal of an earlier edit. State accumulates as the agent works through the task. A lingering process or a cached package at the wrong version can therefore become an input to an unrelated job.
The economic benefit of sharing is also the source of the mismatch. A runner pool amortizes compute across jobs, but an agent relies on an environment that it repeatedly mutates. Reusing that environment connects tasks that should be independent. An agent’s next command depends on what happened during an evolving session.
Three failure modes that appear when agents share runner infrastructure
Environment pollution is the first failure mode. A package installation, patched configuration file, or background service can leave artifacts for the next job. Iteration makes that residue harder to anticipate because an agent may write, overwrite, and partially revert the same files. When tasks share filesystem and package manager state, one task’s dependency resolution becomes part of what the next task uses for its build. A failure during review can then reflect inherited state.
Resource contention is a separate operational problem. Tests, browser sessions, and compilation all need some of the same CPU and memory that ordinary CI jobs need. Standard CI queuing assumes jobs run in short bursts, but an agent may hold a slot for minutes or hours. As agent workloads scale, those sessions compete with both other agents and the pipelines used to assess their output. A clean filesystem alone does not resolve that competition.
The third failure mode is an unpredictable blast radius. Cursor’s local agent has no built-in sandbox, so a shared-runner deployment does not itself provide a filesystem or network boundary around its actions. OpenCode likewise has no OS-level sandbox and allows file edits and shell commands without prompting by default. Its external-directory permission defaults to asking, but that permission is not a kernel boundary. Agent-generated code running with shared credentials and a shared kernel creates a meaningful attack surface, which makes isolation an infrastructure responsibility.
How isolated VM environments for cloud coding agents work
Per-task VM dispatch starts with a fresh machine for each task. That machine has its own filesystem, terminal sessions, network stack, and package manager environment. It clones the repository at the current HEAD of the specified branch, runs setup commands, and hands control to the agent. Success, failure, and crashes all end the environment’s lifetime. Destroying the VM keeps its local changes from carrying over to the next task.
The architecture separates orchestration from execution. Planning, model inference, and task routing can remain in a managed platform, cloud service, or Cloudflare Worker, while generated code and tests run inside the task environment. This separation supports execution on infrastructure the team controls, including environments with VPN-gated APIs, compliance requirements, or specific hardware. Available compute still constrains throughput, but one agent no longer needs to occupy another agent’s operating environment.
The buildd cloud-runner PR #3189, merged September 30, 2026, shows how this lifecycle works with containers. A Cloudflare Worker accepts a task webhook at POST /dispatch, validates the task ID, and routes it to a WorkerAgent Durable Object named by that ID. The worker starts a fresh container from Dockerfile.once, executes buildd-once --task <id>, and destroys the container after the run. Exit codes show whether a run is done, failed, refused, or crashed. The worker is marked failed only when the run itself crashed, separating task results from execution failures.
Deduplication prevents dispatch retries from multiplying active runs. A duplicate arriving while a task is starting or running receives HTTP 202 with accepted set to false, rather than a non-2xx response that would trigger a retry cascade. Each attempt still receives a fresh container. After a successful claim, the agent reads BUILDD_WORKER_ID from exec stdout, while server-side stale detection handles a container that dies before emitting that line. This way of handling crashes works without a shared database or lock file.
The example demonstrates dispatch, deduplication, and destruction. A container isolates processes but shares the host kernel, whereas a VM isolates the kernel itself. That distinction is significant when arbitrary generated code has access to a repository and credentials. The lifecycle generalizes across both approaches, but they provide different execution boundaries.
How Cursor and OpenCode behave differently inside a per-task VM
Cursor supplies a managed cloud execution model that teams configure. Its September 2, 2026 self-hosted infrastructure change lets teams route execution to machines they manage, including auto-scaling pools, while orchestration, planning, and model inference remain inside Cursor. That split addresses the governance gap created when code, dependencies, and environment variables had to live in Cursor’s AWS account.
Cursor’s local and cloud parallelism also need separate treatment. It supports up to 8 agents in parallel across a workspace through local git worktrees, while cloud agents have no stated parallel cap. Worktrees separate working copies while sharing a kernel. They are therefore not substitutes for per-task VMs when the requirement is to isolate agent execution from other workloads.
OpenCode starts from the opposite operational position. It is open-source, terminal-first, supports multiple providers and local models, and can run on a team’s own server. These features let teams control how they deploy OpenCode, but it has no built-in orchestration layer. Its permissive command defaults and lack of an OS-level sandbox mean a disposable container or VM is the minimum safe posture for shared or CI environments.
For an OpenCode deployment, the team supplies the dispatch layer. The buildd pattern is applicable because it separates task identity, duplicate handling, execution, and cleanup without depending on a particular agent’s reasoning loop. Cursor packages more of that operational work into its managed model. OpenCode leaves more of it with the team, even when both ultimately run inside isolated compute.
Workflow integration — how tasks reach the agent and how results come back
Isolation does not require a new intake workflow. Cursor’s Slack Marketplace listing says an @Cursor mention launches an isolated VM that reads the thread, writes code, and posts status updates. When the task finishes, the agent pushes changes and shares a GitHub pull request for review. The VM is an execution detail behind an existing conversation.
The review artifact makes that separation practical. A pull request can include a written summary, the standard GitHub diff, test results and build status from the VM, and a video recording of the session. The recording exposes work that a final diff alone cannot show, including files opened, terminal commands, test outcomes, and error-handling decisions, while preserving the pull request’s review format.
Multi-agent orchestration extends this workflow across harnesses. A shared queue can accept work from Slack, Linear, GitHub, GitLab, a dashboard, or an API, then dispatch each task into its own isolated environment. Analytics identify which agent ran, which trigger supplied the task, who started it, and what it cost. The shared component is the control layer.
Long-running tasks and context management inside isolated VMs
As a session grows longer, the agent’s internal model of the codebase can diverge from the actual disk state. The documented failure mode, “Context Rot,” can appear as calls to non-existent functions or edits to stale file paths. A private VM does not correct stale reasoning. Keeping sessions short or adding re-indexing checkpoints addresses a different problem from isolating the machine.
Cursor’s /best-of-n primitive addresses a related execution choice. Instead of relying on one long attempt, it runs multiple shorter attempts in separate isolated worktrees and returns the best result. This trades sequential iteration time for parallel compute. It offers a way to limit dependence on a single extended attempt.
Destroying a VM wipes its local state, but later tasks can still benefit from project context and lessons from earlier sessions. The agentmemory project at rohitg00/agentmemory provides persistent memory through a server that MCP clients connect to. Opencode Mem serves a similar purpose for OpenCode. These tools keep context outside the disposable execution environment, so the memory can last without keeping the machine.
Source, harness, model, credential, and duration give teams the information needed to identify sessions that reached diminishing returns. Without that record, stale-path edits caused by session management can be misattributed to a poor model choice. Memory and analytics therefore belong with orchestration, where they can survive the destruction of any individual VM.
Running Cursor and OpenCode alongside other agents without locking into either
Once task execution has a stable isolation boundary, the harness becomes a choice made per task. That flexibility avoids tying infrastructure to one agent’s cost model, sandbox posture, or benchmark trajectory. The relevant comparison is broader than coding performance alone. Execution ownership, network access, intake, review output, and runtime accounting determine how an agent fits a production workflow.
The August–September 2026 field illustrates those differences. Claude Code on the web uses vendor-managed VMs and can run sessions in parallel, and Team and Enterprise can use self-hosted execution. Its auto-fix watches pull requests for CI failures and review comments, and its cloud sessions share rate limits with other uses of Claude. Codex cloud instead uses OpenAI-managed containers with a two-phase runtime. Setup has network access, but the agent phase has internet access off by default, which keeps setting up the environment separate from running the agent afterward.
Jules uses a cloud VM running Gemini 3 Pro as of August 2026. It offers an editable execution plan before writing code and automatically detects and fixes CI failures on pull requests it created. Its public API lets teams connect it to CI/CD and to Slack or Linear. These options differ from Cursor’s managed-or-self-hosted model and OpenCode’s team-supplied dispatch layer. Calling these tools cloud agents leaves open what their isolation boundary is and how much work the team has to do to run them.
The Claude Code and Codex spread on a verified coding benchmark is under half a point, while the token cost difference is meaningful. A harness-agnostic orchestration layer can route each task to the selected agent, run it in an isolated, fully configured Linux VM, and return a pull request. Attribution then connects execution time to its source, harness, model, and credential. The team can change the agent without changing the boundary that protects other workloads.


