Skip to content

Refuse an agent that has no agent CLI to run - #104

Merged
vitramir merged 2 commits into
mainfrom
require-environment-on-create-agent
Aug 19, 2026
Merged

Refuse an agent that has no agent CLI to run#104
vitramir merged 2 commits into
mainfrom
require-environment-on-create-agent

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

CreateAgent accepted an agent that named no environment, and one whose environment named no agent runtime image whenever it used the free-form image rather than a catalog one. Both produce an agent the Orchestrator refuses to assemble.

It retries on every reconcile cycle and never stops: an assembly failure writes no workload record, so the start-failure backoff counts nothing and the instance is never paused or degraded. The agent is created, reported as created, goes ACTIVE, and never runs. The only trace is a line in the Orchestrator's own log — which is how it went unnoticed long enough to account for most of the e2e suite failing.

Both writes now resolve the environment through one path that refuses either shape. An empty environment_id on update used to clear the reference; it is refused for the same reason.

Also here: agentIDsForVolume still queried volume_attachments, dropped by migration 0024 when a volume became a sub-resource of what mounts it — so DeleteVolume and every volume notification answered "relation does not exist". It reads volumes now.

Verified on the local bundle VM with agents running from source: the go-core orchestrator suite goes from no agent workload starting at all to 36/45 passing.

An agent takes its CLI from its environment's agent runtime image. init_image
stopped standing in for one when the legacy init container was removed, but
CreateAgent still accepted an agent that named no environment at all -- and an
environment naming no runtime whenever it used the free-form image rather than a
catalog one.

Both produce an agent the Orchestrator refuses to assemble. It retries on every
reconcile cycle and never stops: an assembly failure writes no workload record,
so the start-failure backoff counts nothing and the instance is never paused or
degraded. The agent is created, reported as created, goes ACTIVE, and never
runs. The only trace is a line in the Orchestrator's own log.

Both writes now resolve the environment through one path that refuses either
shape, so the caller is told at the point they can still fix it. An empty
environment_id on update used to clear the reference; it is refused for the same
reason.
A volume stopped being a free-standing row reached through an attachment when it
became a sub-resource of what mounts it, and 0024 dropped volume_attachments
with it. The query naming the agents a volume belongs to was left pointing at
the dropped table, so DeleteVolume and every volume notification answered
"relation volume_attachments does not exist" -- an internal error on a path that
has no reason to fail.

It reads volumes now: a volume hangs off an MCP, whose agent it belongs to, or
off an environment, which every agent running there takes its configuration
from.
@vitramir
vitramir merged commit 4d9e63e into main Aug 19, 2026
1 of 2 checks passed
@vitramir
vitramir deleted the require-environment-on-create-agent branch August 19, 2026 10:09
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.

1 participant