[Bug]: 0.3.3.Final - Agent terminates early when ADK tool returning RxJava Single hops threads
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- kotlin
調査の方向性
バグは DefaultRequestHandler の cleanupProducer メソッドにあり、RxJava Single がスレッドを切り替えると ChildQueue が早期に閉じられます。Agent エンドポイントの処理と、非同期のツール結果をどのように待機しているかを確認してください。まず、別の Dispatcher 上で rxSingle を使用する Kotlin ツールで再現してください。1.0.0 の AgentEmitter を使った修正を確認し、解決方法を理解してください。修正には、適切な同期、または新しいスレッド上で Single の完了を待機する処理が含まれる可能性があります。
索引モデルが issue の本文から書いたものです。
説明
What happened?
When an ADK tool returns an RxJava Single executes on a different thread to the executor, the agent endpoint returns right after the function call is made. I noticed this bug using Kotlin, where using rxSingle executes on the global dispatcher, rather than the executor, e.g:
@Schema(description = "Get the weather summary in a city")
fun getWeather(@Schema(name = "city", description = "City to query") city: String): Single<Map<String, Any>> {
return rxSingle {
mapOf<String, Any>("result" to "It's 50 degrees and partly cloudy in $city")
}
}
When running an agent with this tool, e.g. with message/send, the result cuts out after the tool call.
{
"jsonrpc": "2.0",
"id": "cli-check-2",
"result": {
"id": "565c05e1-8bfc-414c-950e-80d74e14350c",
"contextId": "cli-demo-context",
"status": {
"state": "working",
"timestamp": "2026-05-12T15:09:36.256177Z"
},
"artifacts": [
{
"artifactId": "80c03215-3225-4108-9f7f-040d5ad2ec82",
"parts": [
{
"data": {
"name": "getWeather",
"id": "adk-183771c0-58a0-4f1b-87e9-d406ffaef646",
"args": {
"city": "Edinburgh"
}
},
"metadata": {
"adk_type": "function_call"
},
"kind": "data"
}
],
"metadata": {}
}
],
"history": [
{
"role": "user",
"parts": [
{
"text": "What is the weather in Edinburgh?",
"kind": "text"
}
],
"messageId": "cli-check-2",
"contextId": "cli-demo-context",
"taskId": "565c05e1-8bfc-414c-950e-80d74e14350c",
"kind": "message"
}
],
"kind": "task"
}
}
Using rxSingle(Dispatchers.Unconfined) works only if the function never actually suspends, otherwise the issue persists. A Java equivalent would be to e.g. call .subscribeOn(Schedulers.io()) on the Single, or any other change of Scheduler.
The issue appears to be in the cleanupProducer method of the DefaultRequestHandler, where the ChildQueue is closed prematurely. It does appear to be fixed in 1.0.0 with AgentEmitter - but I'm unsure if we'll be able to adopt it yet as the ADK doesn't support it (I've raised an issue for it here). Is there any chance a fix could be backported to 0.3? I'm happy to provide help if needed.
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要言語
- Java
- スター
- 514
- フォーク
- 200
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 53
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
a2aproject/a2a-java のほかの issue
-
Document 1.x is the actively supported stream, and not 0.3.x対応中かも @Linux2010 が 2 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 62/100
a2aproject/a2a-java#1321 ·
メンテナーはふだん 1 日以内に返信
-
HTTP+JSON CancelTask returns 409 Conflict instead of 400 Bad Request for TaskNotCancelableError再び着手できるかも @ravismash が 9 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
a2aproject/a2a-java#1298 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
fix: handle blank push notification config id consistently across transports対応中かも @prachisinghal-1 が 23 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
a2aproject/a2a-java#1012 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
a2aproject/a2a-java#464 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Create a sample that demonstrates how to use a shared contextId across multiple tasks再び着手できるかも @tanish111 が 390 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンsample
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
a2aproject/a2a-java#375 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
a2aproject/a2a-java の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/skywalking#14239 ·
メンテナーはふだん 1 日以内に返信
-
Re-executed query with IN condition on an index column returns deleted rows (stale IndexCursor)対応中かも @dbusche が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
h2database/h2database#4580 ·
メンテナーはふだん 1 日以内に返信
-
vips-drift
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Stirling-Tools/JPDFium#300 ·
メンテナーはふだん 1 日以内に返信
-
hermes-queue
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
chrisalunlloyd2-sudo/mindpalace#403 ·
メンテナーはふだん 1 日以内に返信
-
Guidelines: document how to build a use case against a local, unpublished Flow/browserless-test change対応中かも @totally-not-ai が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
vaadin/use-cases#452 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信