Skip to content

ate-env-api: report a missing environment as NotFound on guest calls - #125

Open
KR Ravindra (KR-Ravindra) wants to merge 1 commit into
agent-substrate:mainfrom
KR-Ravindra:fix/guest-call-missing-env-notfound
Open

KR Ravindra (KR-Ravindra) wants to merge 1 commit into
agent-substrate:mainfrom
KR-Ravindra:fix/guest-call-missing-env-notfound

Conversation

@KR-Ravindra

Copy link
Copy Markdown

Problem

read, write, shell and MCP tool calls on a deleted or never-created environment fail with Unimplemented instead of NotFound. The router answers a plain HTTP 404 for an actor it has no route to, grpc-go maps that to Unimplemented, and ensureAwake takes any code other than Unavailable as an answer from a live guest, so the control-plane read that would say NotFound never happens.

Fixes #121

Fix

Treat Unimplemented from the wake probe like Unavailable: read the actor state, which surfaces a missing environment as NotFound through toGRPCError. An actor the control plane knows but the router cannot route yet stays on the existing wake/running budgets.

How tested

New TestGuestCallOnMissingEnvironmentIsNotFound fails on main and passes with the change; go test ./..., go vet, gofmt clean.

Experimented and verified with an AI agent.

Signed-off-by: KR Ravindra <42912207+KR-Ravindra@users.noreply.github.com>
@KR-Ravindra
KR Ravindra (KR-Ravindra) force-pushed the fix/guest-call-missing-env-notfound branch from 1740eb9 to b98fa3d Compare November 12, 2026 08:16
@KR-Ravindra
KR Ravindra (KR-Ravindra) marked this pull request as ready for review November 12, 2026 08:17
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.

[Bug Bash] Guest operations (read/write/shell/MCP) on a deleted or non-existent environment fail with Unimplemented instead of NotFound

1 participant