Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: AgentEmitter remains terminal when terminal event enqueue fails

オープン
#1,183 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@kabir がすでに取り組んでいます。

2026年9月25日 から。

評価

この issue はまだ評価されていません。

説明

What happened?

AgentEmitter.updateStatus() and AgentEmitter.fail(A2AError) mark the emitter terminal before calling EventQueue.enqueueEvent().

If enqueueing throws, no terminal event is delivered, but the emitter remains marked terminal. DefaultRequestHandler catches the exception and attempts to report an InternalError through emitter.fail(A2AError). That fallback call then throws: IllegalStateException: Cannot update task status - terminal state already reached

The original enqueue failure is logged, but the secondary terminal state exception escapes the error handling path and prevents the fallback error event from being emitted.

Reproduction steps

This behavior is reproducible using the SDK’s built-in EventQueue, including when a terminal enqueue is interrupted while waiting for queue capacity.

  1. Create an AgentEmitter backed by an EventQueue that throws from enqueueEvent().
  2. Call a terminal operation such as emitter.complete().
  3. Catch the resulting exception, as DefaultRequestHandler does.
  4. Call emitter.fail(new InternalError()).

The fallback operation throws because the first attempt left terminalStateReached set.
Both final status updates through updateStatus() and protocol errors through fail(A2AError) set the terminal flag before enqueueing and are affected.

Reproduced with the SDK’s built-in EventQueue using a size-one queue at capacity and interrupting the terminal enqueue. This was a focused reproduction, not production log output.

Expected behavior

The SDK should handle a failed terminal enqueue without replacing the original failure with a secondary “terminal state already reached” exception. Its terminal state should remain consistent with whether a terminal event was successfully accepted for processing.

Relevant log output
Initial terminal enqueue failure:

java.lang.RuntimeException: Unable to acquire the semaphore to enqueue the event

Fallback failure:

java.lang.IllegalStateException:
Cannot update task status - terminal state already reached
Code of Conduct
  • I agree to follow this project's Code of Conduct
主要言語
Java
スター
495
フォーク
174
平均マージ
1日 14時間
マージ済み PR(30日)
48

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

a2aproject/a2a-java のほかの issue

a2aproject/a2a-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。