Skip to content

feat: update proto convertors in v0#221

Merged
yarolegovich merged 6 commits intospec-v1/type-updatefrom
serob/update-proto-convertors-v0
Feb 18, 2026
Merged

feat: update proto convertors in v0#221
yarolegovich merged 6 commits intospec-v1/type-updatefrom
serob/update-proto-convertors-v0

Conversation

@nahapetyan-serob
Copy link
Collaborator

Modified from_proto.go and to_proto.go to address mapping between new core types and old proto types.
Updated existing tests to reflect the converter changes.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @nahapetyan-serob, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant refactoring of the v0 protobuf converters to align with updated core types within the a2a package. The changes streamline data structures for message parts, agent cards, and security configurations, enhancing consistency and maintainability. The modifications ensure that the conversion logic accurately translates between the new internal representations and their protobuf counterparts, with corresponding updates to the test suite to validate these changes.

Highlights

  • Core Type Alignment: Refactored a2a.MessageSendParams to a2a.SendMessageRequest, a2a.TaskQueryParams to a2a.GetTaskRequest, and similar types across the a2a package to align with new core type definitions.
  • Part Handling Modernization: Updated the a2a.Part interface and its implementations (TextPart, DataPart, FilePart) to a unified a2a.Part struct with a Content interface, simplifying how different message parts are handled.
  • Agent Card Structure Update: Modified the a2a.AgentCard structure to use a SupportedInterfaces slice, which now consolidates ProtocolVersion, URL, and PreferredTransport fields, and introduced ExtendedAgentCard capability.
  • Security Model Refinement: Renamed Security to SecurityRequirements in AgentSkill and AgentCard structs, and updated APIKeySecurityScheme to use Location instead of In for clarity and consistency.
  • Protobuf Converter Updates: Extensively updated from_proto.go and to_proto.go to correctly map between the new a2a core types and the a2apb protobuf types, ensuring seamless data conversion.
  • Test Suite Adjustments: Modified existing test cases in from_proto_test.go and to_proto_test.go to reflect the changes in type definitions and conversion logic, maintaining test coverage and correctness.
Changelog
  • a2a/agent.go
    • Removed extensive comments from SecurityRequirements field.
    • Renamed Security field to SecurityRequirements in AgentSkill struct.
  • a2a/auth.go
    • Added detailed comments to the SecurityRequirementsOptions type definition.
  • a2apb/v0/pbconv/from_proto.go
    • Updated FromProtoSendMessageRequest to return *a2a.SendMessageRequest instead of *a2a.MessageSendParams.
    • Modified fromProtoFilePart to return a2a.Part and handle a2a.Raw and a2a.URL content types.
    • Updated fromProtoPart to return a2a.Part and handle a2a.Text, a2a.Data, a2a.Raw, and a2a.URL content types.
    • Changed fromProtoPushConfig to extract a single scheme from authentication info.
    • Updated fromProtoSendMessageConfig to return *a2a.SendMessageConfig.
    • Modified FromProtoGetTaskRequest to return *a2a.GetTaskRequest.
    • Renamed LastUpdatedAfter to StatusTimestampAfter in FromProtoListTasksRequest.
    • Updated FromProtoGetTaskPushConfigRequest to return *a2a.GetTaskPushConfigRequest.
    • Modified FromProtoDeleteTaskPushConfigRequest to return *a2a.DeleteTaskPushConfigRequest.
    • Removed Final field from TaskStatusUpdateEvent conversion.
    • Updated fromProtoParts to return a slice of *a2a.Part pointers.
    • Modified fromProtoAdditionalInterfaces to construct SupportedInterfaces from AgentCard data.
    • Updated fromProtoCapabilities to accept *a2apb.AgentCard and include ExtendedAgentCard.
    • Refactored fromProtoOAuthFlows to return a single a2a.OAuthFlows interface type.
    • Renamed In field to Location in APIKeySecurityScheme conversion.
    • Updated fromProtoSecurity to return a2a.SecurityRequirementsOptions and use a map for schemes.
    • Modified fromProtoSkills to use SecurityRequirements field.
    • Refactored FromProtoAgentCard to use SupportedInterfaces and ExtendedAgentCard fields.
  • a2apb/v0/pbconv/from_proto_test.go
    • Updated TestFromProto_fromProtoPart test cases to reflect changes in a2a.Part structure and content types.
    • Modified TestFromProto_fromProtoSendMessageConfig test cases to expect *a2a.SendMessageConfig and single authentication scheme.
    • Updated TestFromProto_fromProtoSendMessageRequest test cases to expect *a2a.SendMessageRequest and a2a.ContentParts.
    • Modified TestFromProto_fromProtoGetTaskRequest test cases to expect *a2a.GetTaskRequest.
    • Updated TestFromProto_fromProtoListTasksRequest test cases to use StatusTimestampAfter.
    • Modified TestFromProto_fromProtoGetTaskPushConfigRequest test cases to expect *a2a.GetTaskPushConfigRequest.
    • Updated TestFromProto_fromProtoDeleteTaskPushConfigRequest test cases to expect *a2a.DeleteTaskPushConfigRequest.
  • a2apb/v0/pbconv/to_proto.go
    • Added slices package import.
    • Updated ToProtoSendMessageRequest to accept *a2a.SendMessageRequest.
    • Modified toProtoPushConfig to use a single authentication scheme.
    • Updated toProtoSendMessageConfig to accept *a2a.SendMessageConfig.
    • Modified ToProtoGetTaskRequest to accept *a2a.GetTaskRequest.
    • Updated ToProtoCancelTaskRequest to accept *a2a.CancelTaskRequest.
    • Modified ToProtoTaskSubscriptionRequest to accept *a2a.SubscribeToTaskRequest.
    • Updated ToProtoGetTaskPushConfigRequest to accept *a2a.GetTaskPushConfigRequest.
    • Modified ToProtoDeleteTaskPushConfigRequest to accept *a2a.DeleteTaskPushConfigRequest.
    • Removed Final field from TaskStatusUpdateEvent conversion.
    • Updated toProtoFilePart to accept *a2a.Part and handle a2a.Raw and a2a.URL content.
    • Modified toProtoDataPart to accept *a2a.Part and extract a2a.Data content.
    • Updated toProtoPart to handle a2a.Text, a2a.Data, a2a.Raw, and a2a.URL content types.
    • Modified toProtoParts to accept a slice of *a2a.Part pointers.
    • Updated ToProtoListTasksRequest to use StatusTimestampAfter.
    • Modified ToProtoListTaskPushConfigRequest to accept *a2a.ListTaskPushConfigRequest.
    • Updated toProtoAdditionalInterfaces to use ProtocolBinding.
    • Removed StateTransitionHistory from toProtoCapabilities.
    • Refactored toProtoOAuthFlows to use a switch statement for different OAuth flow types.
    • Renamed In field to Location in APIKeySecurityScheme conversion.
    • Updated toProtoSecurity to accept a2a.SecurityRequirementsOptions.
    • Modified toProtoSkills to use SecurityRequirements field.
    • Refactored ToProtoAgentCard to derive protocol version, URL, and preferred transport from SupportedInterfaces.
  • a2apb/v0/pbconv/to_proto_test.go
    • Updated TestToProto_toProtoMessage test cases to use a2a.ContentParts.
    • Modified TestToProto_toProtoPart test cases to reflect changes in a2a.Part structure and content types.
    • Updated TestToProto_toProtoTaskPushConfig test cases to use a single authentication scheme.
    • Modified TestToProto_toProtoTask test cases to use a2a.ContentParts for message and artifact parts.
    • Updated TestToProto_toProtoAgentCard test cases to reflect changes in AgentCard structure, security schemes, and capabilities.
    • Modified TestToProto_toProtoOAuthFlows test cases to handle single OAuth flow types and removed tests for multiple flows.
    • Updated TestToProto_toProtoSecurityScheme test cases to use Location instead of In for API key schemes.
    • Modified TestToProto_toProtoSendMessageResponse test cases to use a2a.ContentParts.
    • Removed Final field from TaskStatusUpdateEvent in TestToProto_toProtoStreamResponse.
  • a2apb/v1/pbconv/from_proto.go
    • Renamed Security field to SecurityRequirements in fromProtoSkills function.
  • a2apb/v1/pbconv/to_proto.go
    • Added a default error case to toProtoOAuthFlows for unsupported OAuth flow types.
    • Renamed Security field to SecurityRequirements in toProtoSkills function.
  • a2apb/v1/pbconv/to_proto_test.go
    • Updated TestToProto_toProtoAgentCard test case to use SecurityRequirements field.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant refactoring of core data types and their corresponding Protobuf converters for version v0. The changes aim to create a more unified and consistent type system, which is a positive step for maintainability. The updates to from_proto.go, to_proto.go, and the associated test files are extensive and largely well-executed. I've identified one critical issue in the from_proto.go converter that could lead to a panic due to unsafe slice access. Please see the detailed comment for a suggested fix.

@yarolegovich yarolegovich merged commit 1e88639 into spec-v1/type-update Feb 18, 2026
2 checks passed
@yarolegovich yarolegovich deleted the serob/update-proto-convertors-v0 branch February 18, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments