a2aproject / a2aproject/a2a-js

[Clarification]: Evetbus is closed directly after executor has finished

Đang mở
#620 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
613
Fork
169
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
21

Mô tả

We're using the A2A SDK in a different approach that it was actually designed for. Our Executor is basically a proxy to other Agents and in some cases we talk to target Agents via push notification to get their response.

Additionally, we overwrote the DefaultEventBus and replaces it with a Database event bus which adds additional time onto the loop. I don't want to go to much in detail how we did this.

While upgrading to A2A SDK v1 we figured out that we have non deterministic behaviour that sometimes the task was completed, and sometimes it got stuck entirely.

After investigation i found out that you call `_settleBus` in a finally call after the Executor has finished which then sends a finished event to the event bus, and closes the event bus for this task.

In normal circumstances i guess this is fine, to assume that when the Executor is finished, the Task/Loop should be finished as well. In our case never the less, due to the DB loop the event bus was closed before we could read the messages from the DB and everything breaks down. On Top, we have communication with other Agents over Push notification, which results in a very short living Executor because it's only sending the Call to the other agent and finishes - which does not mean the Task is finished.

With the previous A2A SDK 0.3.14 this was not an issue as the loop was closed based on the events status.

Our plan for a mitigation would be to override `_settleBus` and basically do nothing and check in our PersistentEventBus, which we override anyway for the finished events and call the EventBusManager to close the bus for the desired task. This is the easiest way to do this, to not override the DefaultRequestHandler entirely.

1. Do you see any issues with following this approach as we're basically overriding a `_` "private" method. Also in regards of future versions.
2. Would it be an option for you to reconsider your approach as other consumer might run into the same issue when adding more delay or using a DB EventBus as we do.
3. Maybe it can be turned on/off using specific settings/configurations

So, not really a bug, or Feature Request, more like a clarification with you guys about your plans, and talking about options.

Thanks a lot for you Support and awesome work.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Look at the DefaultRequestHandler's _settleBus method and the event bus lifecycle. The issue is about the event bus closing prematurely when using a Database event bus and push notifications. Check how the executor finishes and when the bus is settled. Understanding the custom Database event bus and push notification flow is needed to see the non-deterministic behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, typescript
Lĩnh vực
backend, distributed-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.