[Bug]: CancelTaskRequest.metadata never reaches AgentExecutor.cancel

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

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

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

2026年11月2日 から。

評価

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

説明

maintainers-only
What happened?

CancelTaskRequest has a metadata field (a2a_pb2.pyi; the REST mapping sends the whole request as the body, post: "/tasks/{id=*}:cancel", body: "*" in a2a.proto), but nothing on the server hands it to AgentExecutor.cancel:

  • RestDispatcher.on_cancel_task (src/a2a/server/routes/rest_dispatcher.py) builds CancelTaskRequest(id=task_id) and does not read the body.
  • On every binding, on_cancel_task in DefaultRequestHandlerV2 reads only params.id, and the RequestContext given to cancel has no request (request=None in default_request_handler.py, no request in ActiveTask.cancel). So context.metadata is {} for a cancel, while for SendMessage it returns the request's metadata.

A caller's {"metadata": {...}} therefore never reaches the executor, whichever transport it uses. The Go SDK (gRPC) and the .NET SDK (gRPC and JSON-RPC) do pass it to the executor; only their REST bindings drop it.

Expected: context.metadata of a cancel holds the request's metadata. For REST, decode the body into CancelTaskRequest and keep the id from the path.

Read from the source at 11f1116 (v1.3.0 + 12 commits); I did not run it.

Relevant log output
n/a (found by reading the source)
Code of Conduct
  • I agree to follow this project's Code of Conduct
主要言語
Python
スター
2.2k
フォーク
528
平均マージ
3日 17時間
マージ済み PR(30日)
43

環境構築

はじめの一歩

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

a2aproject/a2a-python のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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