Skip to content

Deleting an agent's Sandbox/Deployment without its AgentRuntime CR leaves the operator in a reconcile error loop #2490

Closed as not planned

Description

@mrsabath

Summary

If you delete an agent's/tool's child workload (the Sandbox for agents, Deployment for tools) but leave the parent AgentRuntime CR, the operator enters a continuous reconcile error loop, logging every ~30s:

Failed to resolve targetRef ... AgentRuntime weather-service ...
  error: agents.x-k8s.io/v1alpha1/Sandbox weather-service not found in namespace team1
Failed to resolve targetRef ... AgentRuntime weather-tool ...
  error: apps/v1/Deployment weather-tool not found in namespace team1

The AgentRuntime's status still reports stale Ready: True from before, while its live condition is TargetResolved: False / TargetNotFound.

Why this bites users

The natural cleanup instinct (and some docs) is kubectl delete deployment,svc,sa -l .... For agents that's doubly wrong: the agent is a Sandbox, not a Deployment (so the delete misses it), and even when children are removed, the orphaned AgentRuntime keeps looping. In our run the loop appeared to interfere with subsequent operations in the namespace.

Expected / suggestions

  • Deleting the child workload could either be blocked (owner reference / finalizer) or the operator should treat a missing target for a still-present AgentRuntime as a non-error state (e.g. recreate, or set a clear Degraded condition and back off) rather than logging a stacktrace every 30s.
  • Docs should instruct deleting the AgentRuntime CR (the parent), which cascades. (Being fixed in the demo docs: Docs: Fix advanced weather-agent demo (token-exchange E2E verified) cortex#819.)

Repro

  1. Deploy an agent (Sandbox) + tool (Deployment) via the UI.
  2. kubectl delete sandbox <agent>; kubectl delete deployment <tool> (leave the AgentRuntimes).
  3. kubectl logs -n rossoctl-system deployment/rossoctl-controller-manager — observe the repeating targetRef errors.
  4. kubectl delete agentruntime <agent> <tool> stops the loop.

Environment

  • Kind on macOS, operator v0.7.0.

Assisted-By: Claude (Anthropic AI) [email protected]

Activity

  1. github-actions commented on Oct 28, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this issue is still relevant, please comment or remove the stale label.

  2. github-actions commented on Nov 11, 2026

    @github-actions

    This issue was closed because it has been stale for 14 days with no activity. Feel free to reopen if this is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions