a2aproject / a2aproject/a2a-js

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

未关闭
#620 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
613
派生
169
平均合并
1 天 6 小时
30 天内合并 PR
21

描述

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.

贡献指南

打开贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, typescript
领域
backend, distributed-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。