Skip to content

atelet: resolve an actor's sandbox runtime from the request's sandbox_runtime - #2788

Merged
Dmitry Berkovich (dberkov) merged 1 commit into
agent-substrate:mainfrom
dberkov:run-by-sandbox-runtime
Oct 17, 2026
Merged

Dmitry Berkovich (dberkov) merged 1 commit into
agent-substrate:mainfrom
dberkov:run-by-sandbox-runtime

Conversation

@dberkov

@dberkov Dmitry Berkovich (dberkov) commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Follows #2755, which put sandbox_runtime on Run and Restore.

Run and Restore stop hashing the request's sandbox_assets to find the runtime to stage, and read the sandbox_bundle_hash attribute of the request's sandbox_runtime instead. That field is what ate-api-server fills from the worker assignment: the runtime the worker registered from the file this node's atelet wrote, so the hash is in the index by construction. The stopgap hashing and its TODOs go.

Required. A request without sandbox_runtime, or without the attribute, is InvalidArgument. Every worker ate-api-server can place an actor on has registered a default runtime, because internal/ateworker/register registers only once the runtimes file names one, so an assignment always has a runtime to send. An unknown hash stays FailedPrecondition. A hash advertised under another sandbox class than the request names is FailedPrecondition too, since the hash does not cover the class.

Not yet. sandbox_assets stays in the request and is no longer consulted. Removing it from the protos, ate-api-server and atelet is the next PR, so this one stays a change to how atelet reads the request.

Tests. The lifecycle tests' Run and Restore requests carry the runtime ate-api-server would send for an actor placed on the worker that advertises their assets. A request with assets but no runtime is InvalidArgument, and still before any on-node work: the invalid-Run test now proves the detach stays scheduled that way instead of through assets for another architecture, which the resolver no longer reads. The resolver test covers the miss, the hit, four malformed runtimes and the class mismatch.

🤖 Generated with Claude Code

…_runtime

Run and Restore found the runtime to stage by hashing the request's
sandbox_assets with the function the syncer hashes a SandboxConfig
version with, a stopgap from before the request named the runtime. The
request now carries sandbox_runtime, filled by ate-api-server from the
worker assignment, which is a runtime the worker registered from the
file this node wrote. So the lookup takes the sandbox_bundle_hash
attribute from there and the hashing goes.

The field is required: a request without it, or without the attribute,
is InvalidArgument. Every worker ate-api-server can place an actor on
has registered a default runtime, since the worker registers only once
its runtimes file names one, so an assignment always has a runtime to
send. A hash the index does not hold stays FailedPrecondition, and so is
a hash advertised under another sandbox class than the request names,
which the hash itself does not cover.

sandbox_assets stays in the request for now and is not consulted; its
removal from the API follows.
@dberkov Dmitry Berkovich (dberkov) added this to the M3 milestone Oct 17, 2026
@dberkov
Dmitry Berkovich (dberkov) added this pull request to the merge queue Oct 17, 2026
Merged via the queue into agent-substrate:main with commit 6b83fda Oct 17, 2026
15 checks passed
Shrutiya Mohan (shrutiyam-glitch) pushed a commit to shrutiyam-glitch/substrate that referenced this pull request Oct 19, 2026
…t in the metrics suite (agent-substrate#2792)

> agent-substrate#2756 has merged; this is one commit on `main`.

The page describes agent-substrate#2756's final design: the default runtime is linked
under the worker's own directory, in a directory per default the
worker's file names, made and removed by the syncer and gone with the
pod, so the on-disk table, syncer section, eviction rule, and runbook
follow that layout and a subsection gives its lifecycle; and with no
budget set atelet starts no eviction pass.

Step 6 of agent-substrate#2675, in its small form: the e2e under eviction pressure was
dropped as too much machinery for what it proves, and this is what
remained worth doing.

**Metrics suite.** `ate_sandboxassetcache_size` joins
`PlatformMetricPrefixes`, so `TestPlatformMetricsEmitted` proves on
every kind lane that atelet registers the instrument, its callback walks
a real cache directory without error, and the OTLP path to the collector
carries it. Only size qualifies: it is an observable instrument read on
every collection, so it has a series from the first export on any
install. The eviction and pass counters emit only once a pass had work
to do, which never happens with the default unbounded budget.

**Doc.** `docs/sandbox-asset-cache.md`, for the operator or engineer who
meets the cache for the first time: what lives under `/var/lib/ate` and
why it must share a mount; how an actor gets its assets, from the
runtime the request names through the index, the cache and the hard
links, and what Run, Restore and Checkpoint each do; how the worker
sandbox syncer decides which runtimes a node needs, prewarms and pins
the defaults, and prunes; the eviction rules and the six flags; the
three metrics and what a shortfall means; a runbook for a node over
budget; and what is deliberately left out. Linked from the README's doc
list, the node supervisor section of the architecture page, and the
metrics paragraph of the observability guide.

The page describes the request as naming the runtime the worker
registered, which is agent-substrate#2788's behavior rather than this stack's. It
documents the state once both land rather than the interim.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants