Skip to content

Build1 publisher2 min readPublished

Cloud Run instances kept an always-on AI agent's state across updates and restarts in a Preview test

Google's Cloud Run instances, priced from $5.70 a month, kept an open-source AI agent running with its memory intact in a developer's Preview test. For an agent that mostly waits, it trades a VM's patching for limits the code must be written around.

The Engineer · Build desk

Illustration accompanying Cloud Run instances kept an always-on AI agent's state across updates and restarts in a Preview test

What happened

  • A standard Cloud Run service shuts down when nobody calls it, and an agent's work loop and memory disappear with it.
  • After exactly one week of uptime Google restarted the instance for maintenance; it was back in about 20 seconds and the agent resumed work a minute and a half later.
  • The instance reserves a small slice of CPU and bursts to full power; in the test a burst lasted about three and a half minutes, and two idle minutes restored it.
  • Each update to the instance cut service for nearly two minutes, according to the author.
  • The instance has no GPU, so the model runs on a separate GPU-equipped Cloud Run service, and only one European region offers both today.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • constraint Storage built for files written whole by one program pushes agent memory into whole-file writes, so a framework that keeps its memory in a database needs that database elsewhere.
  • decision Following the author's tip, config that changes often moves to a secret manager or a storage file, so the container is rebuilt, and taken offline, far less often.
  • cost At $68.40 a year the smallest instance is cheap, but it covers only the agent's container; the GPU service running the model is a separate bill the write-up does not price.

The developer behind the write-up, posted on dev.to under the techtown-fr account, sets out three requirements for a permanent agent [3]. It runs its own schedule and wakes itself, with no external scheduler. Its memory, history and plan have to survive an update or a restart. And it needs a stable address with no server to maintain [3]. Each is well tooled on its own, and the author's complaint is the combination [3]. A VM covers the first two and hands back updates, firewall rules, monitoring and certificates [5]. The author calls that a lot for a program that spends most of its time waiting [5].

Cloud Run instances, in Preview since late August 2026, is a new resource type: one container, always on, with a fixed address and storage that persists [1][6]. The operator's controls are start, stop and update [6]. The author ran Hermes Agent, an open-source agent, on it [2]. Files the agent wrote survived updates, stops and restarts, the address never moved, and traffic to the model stayed off the public internet, according to the write-up [7][8]. A stopped instance costs nothing, and the first complete test session cost two cents [9].

Always-on, in this Preview, means on for a week at a time [15]. In the one maintenance restart the author observed, the agent's own start-up took about 4.5 times as long as the container's return [2]. Recovery time is mostly a property of the agent's code [2]. The agent has to read its schedule back from storage when it wakes, because anything held only in process memory is lost at the restart [15].

The CPU figures describe one agent. For them to transfer, a workload's busy stretches have to finish inside the measured burst window, and the quiet gaps between them have to last at least as long as the measured recovery [11]. The author argues that agents fit that profile: they think, call a tool, wait and resume, and the pricing rewards it [19]. I think that holds for an agent that mostly waits on a remote model. A long test suite run from inside the instance is the case I would measure first.

The sandbox defaults are the best engineering in the write-up. Code the agent generates runs in isolated sandboxes that start in a few tenths of a second [18]. By default they cannot reach the internet, the agent's credentials or its memory, so a hallucinated line has nothing to break [18].

All of this comes from a single developer's test of a Preview product, and some regions do not offer the resource yet [1][12].

What to watch

  • Whether the weekly maintenance restart and the near-two-minute update outage survive when Cloud Run instances leaves Preview.
  • Whether more European regions add both Cloud Run instances and GPU-equipped Cloud Run services in the same region.
  • Google documentation stating what backs the instance's persistent storage and how it behaves under database-style writes.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories