Why a coding agent's edit-test loop should not wait on CI A developer argues that coding agents should run their edit-test loops on isolated per-agent machines rather than pushing commits to CI, since CI runs pay the full pipeline cost, produce logs that are hard for agents to parse, clutter commit history, and consume shared runner capacity. The post recommends splitting checks so fast tests and lint run on the agent's own machine, the full suite runs on the agent's machine or a leased build host before a pull request, and required checks remain the independent CI gate before merge. It points to Sandscale workspaces, each a Firecracker microVM with its own disk, ports, CPU and memory, as a place for that loop to run. There is a pattern that shows up when a team first lets coding agents work on real repositories without running them on anyone's laptop. Nobody wants the agent running tests on a developer's machine, so the agent pushes a commit, CI runs, the agent reads the result, edits, and pushes again. CI becomes the agent's test runner. It works, in the sense that the tests do run somewhere safe. This post is about why it is the wrong loop, and what to do instead. It is not about how to configure CI for agent pull requests; our post on GitHub Actions and agent pull requests https://sandscale.dev/blog/github-actions-run-agent-pr-tests-in-sandbox?ref=devto-agent-edit-test-loop-should-not-wait-on-ci covers triggers, tokens and the pull request target trap. Every iteration pays the whole pipeline. An agent's loop is many small steps: change one function, run its tests, read one failure. A CI run is built for the opposite: check out, install, build, run everything, report. When the agent needs the answer to one test, it waits for all of it, plus the queue in front of it. The feedback is harder to read. On its own machine, the agent runs a command and reads the output directly. Through CI, it has to find the run, fetch the logs through an API or a CLI, and dig the failure out of output written for humans scrolling a web page. Agents are good at many things, and parsing CI logs reliably is not one of the easy ones. The history fills with noise. "fix test", "try again", "fix lint" become commits on a branch, and sometimes in the pull request everyone reviews. Squashing helps at merge time; it does not help the reviewer reading the branch today. It spends shared capacity. CI runners and minutes are shared by the whole team. Five agents each pushing every few minutes can crowd out the people waiting for their own checks. It mixes two jobs. CI is the gate a change must pass before it merges. When it is also the agent's scratch runner, a red build can mean "the agent is still working" or "this change is broken", and people stop trusting red. Split the checks by what they are for: | Check | Purpose | Where it runs | |---|---|---| | The tests for the code the agent just changed | Fast feedback while editing | The agent's own machine | | Lint and type checks | Fast feedback while editing | The agent's own machine | | The full suite before a pull request | Confidence before asking for review | The agent's machine, or a larger leased machine for heavy suites | | The required checks on the pull request | The gate before merge | CI | The first two rows are the loop. They should take as little ceremony as possible, so they belong where the agent already is. The last row is the gate. It should be independent of the agent, run from a clean checkout, and be the same for people and agents. For the third row, when the full suite is heavier than the agent's machine, our post on leasing a build host for a full test suite https://sandscale.dev/blog/build-host-lease-for-a-full-test-suite?ref=devto-agent-edit-test-loop-should-not-wait-on-ci shows how to run just that step on a larger machine and release it afterwards. The reason teams fall back to CI is usually not a love of CI. It is that the alternative was the laptop: a developer's machine, with their credentials, shared between several agents fighting over ports and CPU. CI was the only separate machine available. Give each agent its own machine and the loop has somewhere to run. On Sandscale, each agent gets a workspace https://sandscale.dev/workspaces?ref=devto-agent-edit-test-loop-should-not-wait-on-ci : its own Firecracker microVM with its own disk, ports, CPU and memory, where the repository, installed dependencies and the agent's session persist between sessions. Dependencies are installed once, so running one test file is just running one test file. sandscale workspace create --name agent-search --template-id TEMPLATE ID sandscale workspace ssh agent-search A reviewer can rerun the agent's checks on the same machine without trusting the agent's word for it. workspace exec runs one command there as you and returns the exit code and output; it asks for confirmation first: sandscale workspace exec --ws-id WORKSPACE ID --command ' "sh", "-c", "cd ~/app && npm test -- src/search" ' Claude Code, Codex and Cursor all read AGENTS.md . These lines make the split explicit: Testing - While working, run the tests for the files you changed: npm test --