Skip to content

chore: temp fix module id v1 suffix#254

Merged
nahapetyan-serob merged 6 commits intomainfrom
yarolegovich/temp-fix-compat
Mar 2, 2026
Merged

chore: temp fix module id v1 suffix#254
nahapetyan-serob merged 6 commits intomainfrom
yarolegovich/temp-fix-compat

Conversation

@yarolegovich
Copy link
Copy Markdown
Member

Temporarily revert changes which add v1 suffix for self-importing older version.

re #250

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 implements a temporary fix by reverting the Go module path to its original form, addressing potential conflicts when modules attempt to self-import older versions. The change necessitated a broad update of import statements across the codebase, particularly within the compatibility layer for older API versions. Additionally, the compatibility layer itself underwent refactoring to use internal types, and related tests and migration utilities were removed or updated. The documentation and example code were also adjusted to reflect these module path and API changes.

Highlights

  • Module Path Reversion: The primary change involves temporarily reverting the module path from github.com/a2aproject/a2a-go/v1 back to github.com/a2aproject/a2a-go to address issues with self-importing older versions.
  • Compatibility Layer Refactoring: The a2acompat/a2av0 package has been significantly refactored to use internal compatibility types and functions, replacing direct imports from the legacy a2a-go module and renaming conversion functions for clarity.
  • Documentation and Examples Update: The README.md and various example files have been updated to reflect the new module import paths and to include a new restHandler example in the README.
  • Removal of Compatibility Tests and Migration Adapters: Several compatibility test files and migration adapter files within a2acompat/a2av0 and e2e/compat have been removed, indicating a streamlined approach to compatibility.
  • New Protobuf v0 Definitions: New generated gRPC service definitions and documentation for a2apb/v0 have been added, suggesting an update to the protobuf schema for version 0.
Changelog
  • README.md
    • Updated the go get command to remove the @v0.3.7 suffix.
    • Added a new restHandler example to the server setup instructions.
    • Changed a2a.TextPart to a2a.NextTextPart in the client example.
  • a2a/example_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2aclient/agentcard/resolver.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/agentcard/resolver_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2aclient/auth.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/auth_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/client.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/client_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/factory.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/factory_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2aclient/jsonrpc.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/jsonrpc_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/middleware.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2aclient/rest.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aclient/rest_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2aclient/transport.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2acompat/a2av0/agentcard.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2acompat/a2av0/agentcard_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2acompat/a2av0/conversion_test.go
    • Renamed from a2acompat/a2av0/conversions_test.go.
    • Removed a2alegacy import and updated a2a import.
    • Replaced FromV1Parts with toCompatParts and ToV1Parts with toCoreParts.
    • Updated type assertions from a2alegacy.DataPart to dataPart.
  • a2acompat/a2av0/conversions.go
    • Removed context and log imports.
    • Replaced a2alegacy imports with direct a2a imports.
    • Refactored numerous ToV1* and FromV1* functions to toCompat* and fromCompat* using internal compatibility types.
  • a2acompat/a2av0/doc.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2acompat/a2av0/jsonrpc_client.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Removed a2alegacy import.
    • Replaced FromServiceParams with direct params usage.
    • Replaced FromV1SendMessageRequest with toCompatSendMessageRequest.
    • Replaced a2alegacy.UnmarshalEventJSON with unmarshalEventJSON.
    • Replaced ToV1Event with fromCompatEvent.
    • Replaced FromV1GetTaskRequest with toCompatGetTaskRequest.
    • Replaced a2alegacy.Task with task.
    • Replaced ToV1Task with fromCompatTask.
    • Replaced FromV1CancelTaskRequest with toCompatCancelTaskRequest.
    • Replaced FromV1SubscribeToTaskRequest with toCompatSubscribeToTaskRequest.
    • Replaced FromV1GetTaskPushConfigRequest with toCompatGetTaskPushConfigRequest.
    • Replaced a2alegacy.TaskPushConfig with taskPushConfig.
    • Replaced ToV1TaskPushConfig with fromCompatTaskPushConfig.
    • Replaced FromV1ListTaskPushConfigRequest with toCompatListTaskPushConfigRequest.
    • Replaced FromV1CreateTaskPushConfigRequest with toCompatCreateTaskPushConfigRequest.
    • Replaced FromV1DeleteTaskPushConfigRequest with toCompatDeleteTaskPushConfigRequest.
  • a2acompat/a2av0/jsonrpc_compat_test.go
    • Removed file.
  • a2acompat/a2av0/jsonrpc_server.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Removed a2alegacy import.
    • Replaced ToServiceParams with a2asrv.NewServiceParams.
    • Replaced FromV1Event with toCompatEvent.
    • Replaced a2alegacy.TaskQueryParams with taskQueryParams.
    • Replaced ToV1GetTaskRequest with toCoreGetTaskRequest.
    • Replaced FromV1Task with toCompatTask.
    • Replaced a2alegacy.TaskIDParams with taskIDParams.
    • Replaced ToV1CancelTaskRequest with toCoreCancelTaskRequest.
    • Replaced a2alegacy.MessageSendParams with messageSendParams.
    • Replaced ToV1SendMessageRequest with toCoreSendMessageRequest.
    • Replaced FromV1Event with toCompatEvent.
    • Replaced a2alegacy.SendMessageResult with sendMessageResult.
    • Replaced ToV1SubscribeToTaskRequest with toCoreSubscribeToTaskRequest.
    • Replaced a2alegacy.GetTaskPushConfigParams with getTaskPushConfigParams.
    • Replaced ToV1GetTaskPushConfigRequest with toCoreGetTaskPushConfigRequest.
    • Replaced FromV1TaskPushConfig with toCompatTaskPushConfig.
    • Replaced a2alegacy.ListTaskPushConfigParams with listTaskPushConfigParams.
    • Replaced ToV1ListTaskPushConfigRequest with toCoreListTaskPushConfigRequest.
    • Replaced FromV1TaskPushConfigs with toCompatTaskPushConfigs.
    • Replaced a2alegacy.TaskPushConfig with taskPushConfig.
    • Replaced ToV1CreateTaskPushConfigRequest with toCoreCreateTaskPushConfigRequest.
    • Replaced a2alegacy.DeleteTaskPushConfigParams with deleteTaskPushConfigParams.
    • Replaced ToV1DeleteTaskPushConfigRequest with toCoreDeleteTaskPushConfigRequest.
    • Replaced a2alegacy.AgentCard with agentCardCompat.
    • Replaced FromV1AgentCard with toCompatCard.
  • a2acompat/a2av0/migration.go
    • Removed file.
  • a2acompat/a2av0/types.go
    • Added new file defining compatibility types (sendMessageResult, event, message, taskState, task, taskStatus, artifact, taskArtifactUpdateEvent, taskStatusUpdateEvent, contentParts, part, textPart, dataPart, filePart, filePartContent, fileMeta, fileBytes, fileURI, taskIDParams, taskQueryParams, messageSendConfig, messageSendParams, getTaskPushConfigParams, listTaskPushConfigParams, deleteTaskPushConfigParams, taskPushConfig, pushConfig, pushAuthInfo) for a2av0.
  • a2aext/activator.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aext/activator_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aext/propagator.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aext/propagator_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2aext/utils.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2agrpc/v0/client.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Changed github.com/a2aproject/a2a-go/a2apb to github.com/a2aproject/a2a-go/a2apb/v0.
  • a2agrpc/v0/compat_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2agrpc/v0/handler.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Changed github.com/a2aproject/a2a-go/a2apb to github.com/a2aproject/a2a-go/a2apb/v0.
  • a2agrpc/v0/handler_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Changed github.com/a2aproject/a2a-go/a2apb to github.com/a2aproject/a2a-go/a2apb/v0.
  • a2agrpc/v1/client.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2agrpc/v1/handler.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2agrpc/v1/handler_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2apb/v0/a2a_grpc.pb.go
    • Added new generated gRPC service file for v0.
  • a2apb/v0/doc.go
    • Added new documentation file for a2apb v0.
  • a2apb/v0/pbconv/from_proto.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Changed github.com/a2aproject/a2a-go/a2apb to github.com/a2aproject/a2a-go/a2apb/v0.
  • a2apb/v0/pbconv/from_proto_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Changed github.com/a2aproject/a2a-go/a2apb to github.com/a2aproject/a2a-go/a2apb/v0.
  • a2apb/v0/pbconv/id_codec.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2apb/v0/pbconv/id_codec_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2apb/v0/pbconv/to_proto.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Changed github.com/a2aproject/a2a-go/a2apb to github.com/a2aproject/a2a-go/a2apb/v0.
  • a2apb/v0/pbconv/to_proto_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Changed github.com/a2aproject/a2a-go/a2apb to github.com/a2aproject/a2a-go/a2apb/v0.
  • a2apb/v1/pbconv/from_proto.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2apb/v1/pbconv/from_proto_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2apb/v1/pbconv/to_proto.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2apb/v1/pbconv/to_proto_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/agentcard.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/agentcard_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/agentexec.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/eventqueue/manager.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/eventqueue/manager_in_memory_impl.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/eventqueue/manager_in_memory_impl_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/eventqueue/queue.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/eventqueue/queue_in_memory_impl_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/exectx.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/extensions.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/handler.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Updated comment for WithLogger to reflect the new module path.
  • a2asrv/handler_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/intercepted_handler.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/intercepted_handler_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/jsonrpc.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/jsonrpc_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/middleware.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/push/api.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/push/doc.go
    • Updated comment to reflect the new module path for WithPushNotifications.
  • a2asrv/push/sender.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/push/sender_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/push/store.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/push/store_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/rest.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/rest_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/taskstore/api.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/taskstore/inmemory.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/taskstore/store_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • a2asrv/taskstore/validator.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/taskstore/validator_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/workqueue/pullqueue.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/log to github.com/a2aproject/a2a-go/log.
  • a2asrv/workqueue/pushqueue.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • a2asrv/workqueue/queue.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • e2e/compat/compat_test.go
    • Removed file.
  • e2e/compat/migration_test.go
    • Removed file.
  • e2e/extensions_durations_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • e2e/jsonrpc_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • e2e/tck/sut.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • e2e/tck/sut_agent_executor.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/clustermode/client/main.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/clustermode/server/agent.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/clustermode/server/dbutil.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/log to github.com/a2aproject/a2a-go/log.
  • examples/clustermode/server/eventqueue.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/clustermode/server/main.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/clustermode/server/taskstore.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/clustermode/server/workqueue.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/helloworld/client/main.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/helloworld/server/grpc/main.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/helloworld/server/jsonrpc/main.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • examples/helloworld/server/rest/main.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
    • Updated a comment to reflect the change in REST handler mounting path.
  • go.mod
    • Changed the module path from github.com/a2aproject/a2a-go/v1 to github.com/a2aproject/a2a-go.
  • internal/eventpipe/local.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/eventpipe/local_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/grpcutil/errors.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/grpcutil/errors_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • internal/jsonrpc/jsonrpc.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • internal/jsonrpc/jsonrpc_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • internal/pathtemplate/pathtemplate_test.go
    • Updated a test case template path from /v1/tasks/{*}/ to /tasks/{*}/.
  • internal/rest/rest.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • internal/rest/rest_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • internal/taskexec/api.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/distributed_manager.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/distributed_manager_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/doc.go
    • Updated the link to the sequence diagram to remove the /v1 suffix.
  • internal/taskexec/execution_handler.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/execution_handler_test.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • internal/taskexec/limiter.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/limiter_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/local_manager.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/manager_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/promise.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/subscription.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/subscription_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/work_queue_handler.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskexec/work_queue_handler_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskupdate/final.go
    • Updated import path from github.com/a2aproject/a2a-go/v1/a2a to github.com/a2aproject/a2a-go/a2a.
  • internal/taskupdate/manager.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/taskupdate/manager_test.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/testutil/push_config_store.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/testutil/push_sender.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/testutil/queue.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/testutil/queue_manager.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/testutil/task_store.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/testutil/testexecutor/executor.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
  • internal/testutil/workqueue.go
    • Updated import paths from github.com/a2aproject/a2a-go/v1/... to github.com/a2aproject/a2a-go/....
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
Copy Markdown
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 is a large-scale refactoring that removes the /v1 suffix from the module path and all import paths across the repository. This is a significant but necessary change to resolve Go module versioning issues. As part of this, the compatibility package a2acompat/a2av0 has been refactored to vendor its own legacy types instead of depending on an older version of the module, which is a good improvement for maintainability. I've suggested a small improvement for robustness in one of the new conversion functions.

Comment on lines +525 to +544
switch f := c.File.(type) {
case fileBytes:
bytes, err := base64.StdEncoding.DecodeString(f.Bytes)
if err != nil {
return nil, fmt.Errorf("failed to decode base64 content: %w", err)
}
res[i] = &a2a.Part{
Content: a2a.Raw(bytes),
Metadata: c.Metadata,
MediaType: f.MimeType,
Filename: f.Name,
}
case fileURI:
res[i] = &a2a.Part{
Content: a2a.URL(f.URI),
Metadata: c.Metadata,
MediaType: f.MimeType,
Filename: f.Name,
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The inner switch statement for filePart does not have a default case. While the UnmarshalJSON for filePart seems to ensure that c.File is either fileBytes or fileURI, it's safer to handle unexpected types explicitly. This would make the code more robust against future changes and prevent potential nil pointer issues if an unsupported filePartContent type is ever introduced.

switch f := c.File.(type) {
			case fileBytes:
				bytes, err := base64.StdEncoding.DecodeString(f.Bytes)
				if err != nil {
					return nil, fmt.Errorf("failed to decode base64 content: %w", err)
				}
				res[i] = &a2a.Part{
					Content:   a2a.Raw(bytes),
					Metadata:  c.Metadata,
					MediaType: f.MimeType,
					Filename:  f.Name,
				}
			case fileURI:
				res[i] = &a2a.Part{
					Content:   a2a.URL(f.URI),
					Metadata:  c.Metadata,
					MediaType: f.MimeType,
					Filename:  f.Name,
				}
			default:
				return nil, fmt.Errorf("unsupported file part content type: %T", f)
			}

@nahapetyan-serob nahapetyan-serob merged commit b964514 into main Mar 2, 2026
4 checks passed
@nahapetyan-serob nahapetyan-serob deleted the yarolegovich/temp-fix-compat branch March 2, 2026 09:46
yarolegovich added a commit that referenced this pull request Mar 8, 2026
yarolegovich added a commit that referenced this pull request Mar 16, 2026
…on (#262)

## Description

Ref #257 🦕

### Motivation

The `a2asrv/` server package does not include testable examples
(`Example_*` functions). Usage snippets exist in the README and
`doc.go`, but they are not executable, not validated by `go test`, and
do not render as function-level examples on **pkg.go.dev**.

### Changes

Add `a2asrv/example_test.go` using `package a2asrv_test` (external test
package), following Go's `ExampleXxx` / `ExampleType_Method` naming
convention.

Examples added for the following public API surface:

| Function / Type | Example demonstrates |
|---|---|
| `NewHandler` | Creating a basic request handler with an
`AgentExecutor` |
| `NewHandler` (withOptions) | Creating a handler with
`WithExtendedAgentCard` and `WithCallInterceptors` |
| `NewJSONRPCHandler` | Wrapping a handler with JSON-RPC transport and
registering with `http.ServeMux` |
| `NewStaticAgentCardHandler` | Serving a static `AgentCard` via
httptest and verifying JSON response |
| `NewAgentCardHandler` | Serving a dynamic `AgentCard` via an
`AgentCardProducerFn` |
| `WellKnownAgentCardPath` | Displaying the standard well-known path
constant |
| `WithCallInterceptors` | Adding server-side middleware to a handler |
| `PassthroughCallInterceptor` | Demonstrating the no-op
`Before`/`After` interceptor lifecycle |
| `NewCallContext` | Creating a call context with `ServiceParams` and
reading request metadata |
| `NewServiceParams` | Case-insensitive service parameter lookups |
| `CallContext.Extensions` | Requesting, activating, and inspecting
extensions |

All examples include `// Output:` comments and are validated by `go
test`.

### Tests

The examples themselves are tests — validated through output matching.
All 12 pass. Existing tests are unaffected.

```
go test ./a2asrv/ -v -run Example
```

### Additional context

Import paths follow the current module declaration
(`github.com/a2aproject/a2a-go`), consistent with the temporary revert
in #254 (ref #250). Happy to update if the module path changes.

This is the first of two PRs addressing #257. The second PR will add
examples for `a2aclient/`.

---------

Co-authored-by: Yaroslav <yarolegovich@gmail.com>
yarolegovich added a commit that referenced this pull request Mar 23, 2026
…ation (#263)

## Description

Ref #257 🦕

### Motivation

The `a2aclient/` client package does not include testable examples
(`Example_*` functions). Usage snippets exist in the README, but they
are not executable, not validated by `go test`, and do not render as
function-level examples on **pkg.go.dev**.

### Changes

Add `a2aclient/example_test.go` using `package a2aclient_test` (external
test package), following Go's `ExampleXxx` / `ExampleType_Method` naming
convention.

Examples added for the following public API surface:

| Function / Type | Example demonstrates |
|---|---|
| `NewFromCard` | Creating a client from an `AgentCard` (with live
httptest server) |
| `NewFromEndpoints` | Creating a client from known `AgentInterface`
endpoints |
| `NewFactory` | Setting up a reusable client factory |
| `NewFactory` (withConfig) | Factory with `PreferredTransports`
configuration |
| `Factory.CreateFromCard` | Using factory to create a client from a
card |
| `Factory.CreateFromEndpoints` | Using factory to create a client from
endpoints |
| `WithJSONRPCTransport` | Configuring JSON-RPC transport with a custom
`http.Client` |
| `Resolver.Resolve` | Resolving an `AgentCard` from a URL via
`agentcard.DefaultResolver` |
| `NewResolver` | Creating a resolver with a custom `http.Client` |
| `AuthInterceptor` | Setting up credential-based auth with
`InMemoryCredentialsStore` and adding it to a factory via
`WithCallInterceptors` |
| `WithAdditionalOptions` | Extending a base factory with additional
options |

All examples include `// Output:` comments and are validated by `go
test`.

### Tests

The examples themselves are tests — validated through output matching.
Existing tests are unaffected.

```
go test ./a2aclient/ -v -run Example
```

### Additional context

Import paths follow the current module declaration
(`github.com/a2aproject/a2a-go`), consistent with the temporary revert
in #254 (ref #250). Happy to update if the module path changes.

This is the second of two PRs addressing #257, following the a2asrv/
examples PR (#262). If there are other packages where this kind of
testable examples would be useful, happy to pick them up.

---------

Co-authored-by: Yaroslav <yarolegovich@gmail.com>
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