A2aAgentExecutor has no native way to emit TaskState.rejected on the server side

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

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

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

2026年11月23日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
ai, api

調査の方向性

Start in google/adk/a2a/executor/a2a_agent_executor_impl.py around _handle_request and in google/adk/a2a/executor/task_result_aggregator.py where terminal states are tracked, then check google/adk/a2a/converters/to_adk_event.py to see how TS_REJECTED is already read on the client side. Settle on a server-side signal (exception type or event action flag) with the maintainers before coding. Done means a rejection maps to TS_REJECTED with priority above completed and distinct from failed, with tests covering both paths.

索引モデルが issue の本文から書いたものです。

説明

a2a needs review
Environment
  • google-adk==2.15.0
  • a2a-sdk==0.3.26
  • Python 3.12
Problem

In the A2A specification, TaskState.rejected (TASK_STATE_REJECTED in v1.0) represents a policy/business refusal distinct from a technical execution failure (failed).

In google-adk==2.15.0:

  • The client converter (google/adk/a2a/converters/to_adk_event.py:70) recognizes _compat.TS_REJECTED in _TASK_RESPONSE_BOUNDARY_STATES.
  • On the server side, A2aAgentExecutor (google/adk/a2a/executor/a2a_agent_executor_impl.py:266-297) and TaskResultAggregator (google/adk/a2a/executor/task_result_aggregator.py:55-60) only track canceled, failed, auth_required, input_required, working, and completed. There is no ADK primitive (tool return contract, EventActions field, or mapped exception) for an agent or tool exposed via to_a2a() to emit TaskState.rejected.

Without a workaround, policy refusals end up either as completed (if the tool returns a refusal dict and the LLM explains it in text) or as failed (if an uncaught exception is raised, which clients interpret as a transient error rather than a semantic rejection).

Workaround
  1. Record a rejection reason from the remote tool / callback (e.g. in session-scoped store or state).
  2. In an ExecuteInterceptor.after_agent passed to A2aAgentExecutorConfig, replace the terminal TS_COMPLETED TaskStatusUpdateEvent with a new TaskStatusUpdateEvent carrying _compat.TS_REJECTED (final=True) and the refusal message.
Suggested Fix in ADK

Provide a native server-side signal in ADK mapped by TaskResultAggregator / A2aAgentExecutor to _compat.TS_REJECTED — for example:

  • a dedicated exception type (e.g. A2aTaskRejectedError or policy rejection error) or an EventActions / ToolContext action flag honored by TaskResultAggregator and A2aAgentExecutor._handle_request (with priority above completed and distinct from failed).
主要言語
Python
スター
22.3k
フォーク
4.4k
平均マージ
1日 2時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

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

google/adk-python のほかの issue

google/adk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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