@@ -159,13 +159,15 @@ func (a *A2ARegistrar) upsertAgentHandler(ctx context.Context, agent v1alpha2.Ag
159159 httpClient := debugHTTPClient ()
160160 client , err := a2aclient .NewFromEndpoints (
161161 ctx ,
162- // TODO: Switch this to 1.0 in release 0.11.0 when all agents are migrated to v1
162+ // TODO(0.11.0): Prefer A2A 1.0 interfaces by default once managed runtimes are v1-capable.
163+ // Keep legacy fallback during rollout so old agent pods continue to serve traffic.
163164 filterInterfacesByVersion (card .SupportedInterfaces , a2atype .ProtocolVersion ("0.3" )),
164165 a2aclient .WithJSONRPCTransport (httpClient ),
165- // TODO: Remove this in release 0.11.0 when all agents are migrated to v1
166+ // TODO(cleanup) : Remove the compat transport after legacy runtimes are unsupported.
166167 a2aclient .WithCompatTransport (
167168 a2atype .ProtocolVersion ("0.3" ),
168169 a2atype .TransportProtocolJSONRPC ,
170+ // This creates a legacy JSON-RPC transport that is used to forward traffic to agents that are still on the legacy A2A wire.
169171 a2aclient .TransportFactoryFn (func (_ context.Context , _ * a2atype.AgentCard , iface * a2atype.AgentInterface ) (a2aclient.Transport , error ) {
170172 return a2av0 .NewJSONRPCTransport (a2av0.JSONRPCTransportConfig {
171173 URL : iface .URL ,
@@ -224,6 +226,7 @@ func a2aRoutePath(agent v1alpha2.AgentObject) string {
224226 return routeKey (agent .GetWorkloadMode () == v1alpha2 .WorkloadModeSandbox , agentRef .Namespace , agentRef .Name )
225227}
226228
229+ // cloneInterfacesWithURL clones the interfaces and sets the URL to the given value.
227230func cloneInterfacesWithURL (interfaces []* a2atype.AgentInterface , url string ) []* a2atype.AgentInterface {
228231 if len (interfaces ) == 0 {
229232 return []* a2atype.AgentInterface {
@@ -249,6 +252,8 @@ func cloneInterfacesWithURL(interfaces []*a2atype.AgentInterface, url string) []
249252 return result
250253}
251254
255+ // filterInterfacesByVersion filters the interfaces to only include the ones that match the given version.
256+ // Currently, this is used to select the A2A 0.3 interface for managed agents.
252257func filterInterfacesByVersion (interfaces []* a2atype.AgentInterface , version a2atype.ProtocolVersion ) []* a2atype.AgentInterface {
253258 filtered := make ([]* a2atype.AgentInterface , 0 , len (interfaces ))
254259 for _ , i := range interfaces {
0 commit comments