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

未關閉
#1,415 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 2 天內回覆

@muscariello 已經在處理了。

開始於 2026年11月2日。

  • #1416 來自 @mykytanetipa —— 未關閉

評估

這個 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
分支
532
平均合併
3 天 11 小時
30 天內合併 PR
43

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

a2aproject/a2a-python 的其他 Issue

查看 a2aproject/a2a-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。