Without setting MessageID, the Go ADK agent server rejects the message with "message ID is required" and returns an error with data: {object} format. The kagent controller's A2A relay (using a2a-go/v2) then fails to parse this error response since it expects data: [array] format, causing a -32603 internal error to be returned. Setting MessageID: uuid.New().String() resolves the entire chain. Tested with kagent v0.10.1 on EKS.
File to change: internal/client/kagent_client.go line ~191
Change:
// BEFORE
res, err := a2a.SendMessage(sendCtx, protocol.SendMessageParams{
Message: protocol.Message{
Role: protocol.MessageRoleUser,
ContextID: &sessionID,
Parts: []protocol.Part{protocol.NewTextPart(text)},
},
})
// AFTER
res, err := a2a.SendMessage(sendCtx, protocol.SendMessageParams{
Message: protocol.Message{
MessageID: uuid.New().String(),
Role: protocol.MessageRoleUser,
ContextID: &sessionID,
Parts: []protocol.Part{protocol.NewTextPart(text)},
},
})
Also add the import (already a dependency in go.mod):
"github.com/google/uuid"
Without setting MessageID, the Go ADK agent server rejects the message with "message ID is required" and returns an error with data: {object} format. The kagent controller's A2A relay (using a2a-go/v2) then fails to parse this error response since it expects data: [array] format, causing a -32603 internal error to be returned. Setting MessageID: uuid.New().String() resolves the entire chain. Tested with kagent v0.10.1 on EKS.File to change: internal/client/kagent_client.go line ~191
Change:
// BEFORE
res, err := a2a.SendMessage(sendCtx, protocol.SendMessageParams{
Message: protocol.Message{
Role: protocol.MessageRoleUser,
ContextID: &sessionID,
Parts: []protocol.Part{protocol.NewTextPart(text)},
},
})
// AFTER
res, err := a2a.SendMessage(sendCtx, protocol.SendMessageParams{
Message: protocol.Message{
MessageID: uuid.New().String(),
Role: protocol.MessageRoleUser,
ContextID: &sessionID,
Parts: []protocol.Part{protocol.NewTextPart(text)},
},
})
Also add the import (already a dependency in go.mod):
"github.com/google/uuid"