{
  "id": 12935083,
  "title": "The agent finished. Who turns off the VM?",
  "url": "https://urgent.news/2026/10/08/the-agent-finished-who-turns-off-the-vm",
  "topic": "ai",
  "section": "AI",
  "published": "2026-10-08T19:24:22.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/danilgaleev/the-agent-finished-who-turns-off-the-vm-5h9i"
  },
  "original_language": "en",
  "account": "When a coding agent finishes its task, several components may still need to remain active. The agent's command, session, and workspace are three separate elements that do not automatically control each other. For example, during a pull request review, the agent's task might finish, but the machine still needs to serve the preview until someone looks at it or it can be rebuilt the next day.\n\nThe agent session should end when the agent hands over the result and the review evidence is saved. The preview should only be retained until an explicit expiry time. This policy separates the agent's completion from other aspects of the task, ensuring that each component is managed independently.\n\nFor instance, a Node.js project can utilize a Bash script with GNU timeout to limit the execution time of tests. If the command does not exit within the specified time frame, a termination signal is sent. However, this approach does not provide a reliable boundary for the agent itself, as an active workspace may never become idle. An inactivity timer could be a solution, but its effectiveness depends on how activity is defined.\n\nThe actual implementation of this policy depends on the agent platform. It is a policy to be tested and refined, as not all agent platforms provide the same controls. A key consideration is preserving evidence before removing the workspace, especially when the only copy of a change or test output lives on the stopped machine. This ensures that useful logs and test results are not lost.\n\nWhen stopping an EC2 instance, it is important to distinguish between termination and stopping. Stopping an EC2 instance retains the instance, its data, and associated resources, while terminating it releases those resources. If uncommitted changes or untracked files remain after stopping the agent, Git refuses removal until they are resolved. Therefore, it is crucial to check the commit status and retention rules before removing the worktree.\n\nTo test this setup, run a failed task with an expired deadline and observe the agent's behavior, including whether the logs survive and which resources remain active. Then, run a successful task with an unavailable reviewer, ensuring the preview remains available for the promised window without requiring the agent to continue working. By comparing these two cases, you can better understand the readiness of the system and the reasons behind its functioning.",
  "summary": "Suppose a coding agent opens a pull request at 6 p.m. The tests pass, a preview is running, and the reviewer has already logged off. The agent's task is complete. The machine still has something to do: serve that preview until someone looks at it. Or perhaps it doesn't. Perhaps the preview can be rebuilt tomorrow and the workspace should shut down now. Either choice is reasonable. Leaving it…",
  "key_points": [
    "Agent session ends when task result is saved",
    "Preview retained only until explicit expiry time",
    "Workspace removal depends on commit status"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}