📋 Prerequisites
🎯 Affected Service(s)
Multiple services / System-wide issue
🚦 Impact/Severity
Blocker
🐛 Bug Description
Bug Description
kagent invoke fails with a JSON-RPC internal error for all declarative agents. The controller selects the wrong A2A transport version when an agent's card does not advertise SupportedInterfaces, causing a JSON unmarshalling panic when the agent returns any error response.
🔄 Steps To Reproduce
- Install kagent 0.10.0-beta7
- Create a declarative agent via
kubectl apply
- Run:
kagent invoke --agent <agent-name> --task "hello"
🤔 Expected Behavior
The agent responds to the task normally, same as when invoked via the UI.
📱 Actual Behavior
ERROR client/client.go:302 JSON-RPC error in SSE event for request : jsonrpc error -32603:
failed to decode response: json: cannot unmarshal object into Go struct field
Error.error.data of type []*errordetails.Typed
The invocation always fails. The UI works fine for the same agent.
💻 Environment
- kagent version: 0.10.0-beta7
- Controller image:
ghcr.io/kagent-dev/kagent/controller:0.10.0-beta7
- Kubernetes: GKE
- OS: macOS
🔧 CLI Bug Report
No response
🔍 Additional Context
Possible Root Cause
File: go/core/internal/a2a/a2a_registrar.go
Function: filterInterfacesByVersion
The controller registers a v0.3 compat transport (a2av0.NewJSONRPCTransport) to talk to agent pods, but it is only selected when the agent card advertises SupportedInterfaces with ProtocolVersion: "0.3". Declarative agents created via kubectl apply do not advertise SupportedInterfaces, so filterInterfacesByVersion returns unversioned interfaces and the v1 transport is selected instead.
When the agent pod returns any error (e.g. a 400 from the upstream LLM), the v1 transport tries to decode error.data as []*errordetails.Typed (array), but the agent pod running the v0.3 wire format sends it as a JSON object {}. Unmarshalling fails and the controller returns a -32603 internal error to the CLI.
Workaround
Port-forward directly to the agent pod (bypassing the controller) and call it via curl:
kubectl port-forward -n kagent svc/<agent-name> 9091:8080
curl -s -X POST http://localhost:9091 \
-H "Content-Type: application/json" \
-d "{
\"jsonrpc\":\"2.0\",
\"method\":\"message/send\",
\"params\":{
\"message\":{
\"messageId\":\"msg-1\",
\"role\":\"user\",
\"parts\":[{\"kind\":\"text\",\"text\":\"your task here\"}]
}
},
\"id\":1
}" | jq '.result.artifacts[0].parts[0].text'
📋 Logs
📷 Screenshots
No response
🙋 Are you willing to contribute?
📋 Prerequisites
🎯 Affected Service(s)
Multiple services / System-wide issue
🚦 Impact/Severity
Blocker
🐛 Bug Description
Bug Description
kagent invokefails with a JSON-RPC internal error for all declarative agents. The controller selects the wrong A2A transport version when an agent's card does not advertiseSupportedInterfaces, causing a JSON unmarshalling panic when the agent returns any error response.🔄 Steps To Reproduce
kubectl apply🤔 Expected Behavior
The agent responds to the task normally, same as when invoked via the UI.
📱 Actual Behavior
The invocation always fails. The UI works fine for the same agent.
💻 Environment
ghcr.io/kagent-dev/kagent/controller:0.10.0-beta7🔧 CLI Bug Report
No response
🔍 Additional Context
Possible Root Cause
File:
go/core/internal/a2a/a2a_registrar.goFunction:
filterInterfacesByVersionThe controller registers a v0.3 compat transport (
a2av0.NewJSONRPCTransport) to talk to agent pods, but it is only selected when the agent card advertisesSupportedInterfaceswithProtocolVersion: "0.3". Declarative agents created viakubectl applydo not advertiseSupportedInterfaces, sofilterInterfacesByVersionreturns unversioned interfaces and the v1 transport is selected instead.When the agent pod returns any error (e.g. a 400 from the upstream LLM), the v1 transport tries to decode
error.dataas[]*errordetails.Typed(array), but the agent pod running the v0.3 wire format sends it as a JSON object{}. Unmarshalling fails and the controller returns a -32603 internal error to the CLI.Workaround
Port-forward directly to the agent pod (bypassing the controller) and call it via curl:
📋 Logs
📷 Screenshots
No response
🙋 Are you willing to contribute?