Skip to main content
This is an optional extension of the Running Agents on Sandboxes tutorial. Complete the main tutorial first.
The starter image is used when you start a devbox without specifying an image, and as the default base when you build a blueprint without providing Dockerfile content. It includes:
  • Core tools: jq, sudo
  • Extras: dnsutils, iputils-ping, less, vim, rsync, gh
  • Python stack: Python 3.12, pip, uv
  • Node stack: Node 22.15.0, npm, Yarn 1.22.22 via corepack

Overview

Instead of shutting down the devbox after pushing a branch and recreating a fresh environment every time you get feedback, you can use Runloop’s suspend and resume functionality to preserve the devbox’s disk state. This allows you to respond to code review comments and make incremental changes without losing your in-progress work.
Devboxes are by definition ephemeral environments. Please consistently snapshot your devboxes to maintain disk state for your projects.
1

Push branch and create a pull request

Push your branch to the remote repository and create a pull request for review.
2

Suspend the devbox

Suspend the devbox to save the disk state while stopping compute costs. The devbox can be resumed later to continue working.
Suspended devboxes preserve all disk state, including your code changes, installed packages, and file modifications, but in-memory state (running processes) is lost. If you need to keep in-memory data, make sure to serialize it to disk (for example, by writing files or updating a database) before suspending. Suspended devboxes still incur storage charges until explicitly shut down.
3

Wait for PR comment and process feedback

Wait for a comment on your pull request. When a comment is received, call a function to resume the devbox and process the feedback. In a production workflow, you would typically use GitHub webhooks (or at least a more robust polling loop) to detect when a comment is added; for simplicity, this example checks for comments manually in a loop.
For production use, prefer GitHub webhooks together with a GitHub App to receive PR comment events and trigger your workflow, instead of relying on a long-running polling loop as shown here.
4

Define the feedback processing function

Define the function that resumes the devbox and processes the PR feedback. This function handles resuming the devbox, recreating the shell, making changes based on feedback, and pushing updates.
You can repeat the suspend/resume cycle as many times as needed to iterate on PR feedback. The devbox preserves all your work between sessions, making it easy to pick up where you left off.

Next Steps