[v1.0] Expected breaking API changes #205
yarolegovich
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The work on v1.0 migration is ongoing in release/spec-v1.
The breaking changes described here are not required for implementing the new specification. We're using this major version increment to introduce more structure and consistency into the public API, address some technical debt and make the SDK more configurable.
AgentExecutor
a2asrv.AgentExecutorgets decoupled fromeventqueue.Queue. This was a misleading legacy API artifact: queues passed to agents were not created byeventqueue.Manager.AgentExecutor-generated events are first processed by theA2Aserver stack and only get into the queue after being stored in theTaskStore.An attempt to
Readfrom the provided queue on theAgentExecutorside would lead topanic.ExecuteandCancelwill now returniter.Seq2[a2a.Event, error].TaskStore
a2asrv/taskstorepackage gets introduced withTaskStoreinterface and the the default in-memory implementation.This is better aligned with
a2asrv/eventqueueanda2asrv/workqueue.TaskStoreis a low-level component needed in different parts of the project. Previously it couldn't be referenced by these because of a circular dependency (TaskStoredefined ina2asrvbut also needed bya2asrvdependencies).a2a.TaskVersiongets moved to the new package.a2apackage is only intended for core protocol types shared by server and client,TaskVersionwas not on the of them.TaskStore.Savemethod will likely be replaced with separateCreateandUpdatemethods to make it easier for implementers to handle these cases separately. New structs will be introduced for grouping values.EventQueue
eventqueue.Queuegets removed and replaced with separatedeventqueue.Readerandeventqueue.Writer.eventqueue.Messagegets introduced for groupinga2a.Task,taskstore.TaskVersionanda2a.ProtocolVersion. The protocol version will not be used for now, but will likely be needed to support rolling upgrades with breaking changes in the future. Protocol version is exported froma2apackage.eventqueue.Managercreates readers and writers separately.If you had a custom manager implementation you can migrate it by removing
Getand returningGetOrCreateresult from bothCreateWriterandCreateReader.A custom queue implementation can be migrated by wrapping the data types it operated with into
Messageand usinga2a.Versionconstant for settingMessage.ProtocolVersion.Interceptor
a2aclient.CallInterceptoranda2asrv.CallInterceptorcan now return a value fromBefore. This allows to return a result without performing the actual call (re [Feat]: Support early return from client interceptors #130). To migrate your implementation simply addnilas the second return values.a2aclient.WithInterceptorsgets renamed toa2aclient.WithCallInterceptorsto better match the API provided bya2asrv.a2asrv.WithCallInterceptorgets renamed toa2asrv.WithCallInterceptorsand takes vararg to match the API provided bya2client.User
a2asrv.Userget changed from an interface to a struct. Extensibility is now achieved usingAttributes map[string]any.This change will allow us to implement auth info propagation in distributed mode in a simpler way. Previously we would need to introduce
AuthMarshalerabstraction and require users to provide it.RequestContext
a2asrv.RequestContextgets renamed intoa2asrv.ExecutorContext. The old naming was misleading because agent execution is happening in the detached (non-request) context.a2asrv.RequestContextInterceptorbecomesa2asrv.ExecutorContextInterceptor.UserandServiceParamsare added to the struct. Previously implementations could retrieve them froma2asrv.CallContextbut the class becomes reserved for request scope now. In distributed modea2asrv.CallContextwill not be retrievable from context.ReqMeta & CallMeta
a2asrv.ReqMetaanda2asrv.CallMetaare renamed toServiceParamsin both packages.Metadatain payloads which was a common point of confusion.Push Notifications
a2asrv.PushSenderanda2asrv.PushConfigStorewill be moved toa2asrv/pushfor consistency with the rest of the abstractions.a2asrv.PushSenderwill be takinga2a.Eventinstead ofa2a.Taskbecause event will be the payload of push notification as per the new spec.Transport
ServiceParamsare now passed explicitly toa2aclient.Transport, so the method for extracting them from context was removed.All reactions