From d8a18a0c156cbcd39ee6d81e2861b01d0bb1a71b Mon Sep 17 00:00:00 2001 From: AK Date: Wed, 4 Mar 2026 21:34:53 -0600 Subject: [PATCH 1/3] Update GetTaskRequest conversion logic, nil pointer check is mandatory for requests that has not set historylen Refactor GetTaskRequest conversion to conditionally set HistoryLength only if provided. --- a2apb/v1/pbconv/to_proto.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/a2apb/v1/pbconv/to_proto.go b/a2apb/v1/pbconv/to_proto.go index 34235b2f..706c748a 100644 --- a/a2apb/v1/pbconv/to_proto.go +++ b/a2apb/v1/pbconv/to_proto.go @@ -127,11 +127,18 @@ func ToProtoGetTaskRequest(req *a2a.GetTaskRequest) (*a2apb.GetTaskRequest, erro return nil, nil } - return &a2apb.GetTaskRequest{ + pbReq := &a2apb.GetTaskRequest{ Tenant: req.Tenant, Id: string(req.ID), - HistoryLength: proto.Int32(int32(*req.HistoryLength)), + //HistoryLength: proto.Int32(int32(*req.HistoryLength)), }, nil + + //only set HistoryLength if it's provided (not nil) + if req.HistoryLength != nil { + pbReq.HistoryLength = proto.Int32(int32(*req.HistoryLength)) + } + + return pbReq, nil } // ToProtoCancelTaskRequest converts a [a2a.CancelTaskRequest] to a [a2apb.CancelTaskRequest]. From 8fdce9e490401da14fad64355538a49c80775c6d Mon Sep 17 00:00:00 2001 From: AK Date: Wed, 4 Mar 2026 21:38:37 -0600 Subject: [PATCH 2/3] Refactor GetTaskRequest conversion logic --- a2apb/v1/pbconv/to_proto.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/a2apb/v1/pbconv/to_proto.go b/a2apb/v1/pbconv/to_proto.go index 706c748a..66c1940f 100644 --- a/a2apb/v1/pbconv/to_proto.go +++ b/a2apb/v1/pbconv/to_proto.go @@ -127,18 +127,16 @@ func ToProtoGetTaskRequest(req *a2a.GetTaskRequest) (*a2apb.GetTaskRequest, erro return nil, nil } - pbReq := &a2apb.GetTaskRequest{ + result := &a2apb.GetTaskRequest{ Tenant: req.Tenant, Id: string(req.ID), - //HistoryLength: proto.Int32(int32(*req.HistoryLength)), - }, nil + } - //only set HistoryLength if it's provided (not nil) if req.HistoryLength != nil { - pbReq.HistoryLength = proto.Int32(int32(*req.HistoryLength)) + result.HistoryLength = proto.Int32(int32(*req.HistoryLength)) } - return pbReq, nil + return result, nil } // ToProtoCancelTaskRequest converts a [a2a.CancelTaskRequest] to a [a2apb.CancelTaskRequest]. From 0e8a9b8abc686980755d949ab7789dd63657614c Mon Sep 17 00:00:00 2001 From: Ashish Kumar Date: Wed, 4 Mar 2026 22:11:33 -0600 Subject: [PATCH 3/3] formatted --- a2apb/v1/pbconv/to_proto.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/a2apb/v1/pbconv/to_proto.go b/a2apb/v1/pbconv/to_proto.go index 66c1940f..70ff8124 100644 --- a/a2apb/v1/pbconv/to_proto.go +++ b/a2apb/v1/pbconv/to_proto.go @@ -128,13 +128,13 @@ func ToProtoGetTaskRequest(req *a2a.GetTaskRequest) (*a2apb.GetTaskRequest, erro } result := &a2apb.GetTaskRequest{ - Tenant: req.Tenant, - Id: string(req.ID), + Tenant: req.Tenant, + Id: string(req.ID), } if req.HistoryLength != nil { result.HistoryLength = proto.Int32(int32(*req.HistoryLength)) - } + } return result, nil }