feat(agent): allow declarative agents to call agents in other clusters#2130
Draft
tjorourke wants to merge 1 commit into
Draft
feat(agent): allow declarative agents to call agents in other clusters#2130tjorourke wants to merge 1 commit into
tjorourke wants to merge 1 commit into
Conversation
4a4a1a1 to
bf7ff59
Compare
Cross-cluster agent-to-agent (A2A) already works for BYO agents: the BYO
container makes the A2A call to the remote agent itself, so nothing needs to be
resolved. It does NOT work for declarative agents.
A declarative agent-as-tool (tools[].type: Agent) is resolved by the controller
with a lookup in its OWN cluster's API. An agent in another cluster isn't there,
so the referencing agent never starts:
Agent.kagent.dev "remote-agent" not found
Fix: let an Agent tool reference carry an optional `url` (and `description`).
When a url is set, the agent calls that remote A2A endpoint directly — e.g. an
agent in another cluster reached over an east-west gateway — instead of
resolving a local Agent CR. This gives declarative agents the same cross-cluster
reach BYO already has. Name-based references are unchanged.
tools:
- type: Agent
agent:
name: remote-agent
url: http://remote-agent.kagent.svc.cluster.local:8080
Fixes: solo-io/kagent-enterprise#1853
Signed-off-by: Thomas O'Rourke <tom.orourke@solo.io>
bf7ff59 to
0ac7433
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Cross-cluster agent-to-agent (A2A) already works for BYO agents — the BYO container makes the A2A call to the remote agent itself, so nothing is resolved. It does not work for declarative agents.
A declarative agent-as-tool (
tools[].type: Agent) is resolved by the controller with a lookup in its own cluster's API. An agent in another cluster isn't there, so the referencing agent never starts:Tracking issue: solo-io/kagent-enterprise#1853 (Telefonica).
The fix
Let an Agent tool reference carry an optional
url(anddescription). When aurlis set, the agent calls that remote A2A endpoint directly — e.g. an agent in another cluster reached over an east-west gateway — instead of resolving a local Agent CR. Declarative agents get the same cross-cluster reach BYO already has. Name-based references are unchanged.Under the hood this reuses the exact
RemoteAgentConfigthe local path already builds (Url = toolAgentURL(agent)); it just lets you supply the URL instead of deriving it from a local CR.Backward compatibility
Purely additive — safe:
url/descriptionare optional; nothing removed, renamed, or retyped;namestays required.Agentobjects validate and behave identically. No storage-version change.urlis pruned and the feature no-ops (no break); new CRD + old controller ⇒urlstored but ignored. Neither breaks existing agents.Files
go/api/v1alpha2/agent_types.go—url/descriptiononTypedReferencego/core/internal/controller/translator/agent/compiler.go— URL fast-path at both resolution sitesgo/core/internal/controller/translator/agent/remote_url_agent_tool_test.go— new unit testcontroller-gen(make manifests) + synced to the Helm chart (make controller-manifests)Testing Proof
gofmt -lclean ·go vetclean · deepcopy unchanged. A full end-to-end two-cluster (east↔west over an east-west gateway) live run is being captured and will be added here.Live end-to-end proof — cross-cluster declarative A2A (patched OSS kagent v0.9.11)
Two kind clusters, Solo Istio ambient federation + east-west gateway, patched controller on both:
Declarative agents Ready on both clusters (west = remote specialist, east = orchestrator that references it cross-cluster via url):
The east orchestrator's cross-cluster tool reference (the new field):
Accepted condition (was
ReconcileFailed: Agent.kagent.dev "remote-agent" not foundbefore the fix):Live A2A call — invoking the EAST orchestrator; it delegates over A2A to the WEST agent and returns its answer:
The reply comes from the WEST cluster's agent — proving a declarative EAST agent successfully used a declarative WEST agent over A2A across clusters.
What may be a better approach here (maybe another PR in future?)
The ideal long-term UX is the controller auto-deriving the federated URL from a name+cluster reference (so users don't hand-type it), but that needs the controller to know cross-cluster topology. The explicit url is the pragmatic MVP that works with any mesh/gateway today.
Checklist
controller-gencodegen + Helm CRD sync