HTTP+JSON CancelTask returns 409 Conflict instead of 400 Bad Request for TaskNotCancelableError
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、HTTP+JSONトランスポートがTaskNotCancelableErrorをどのようにHTTPステータスに対応付けているかをたどり、その対応付けを仕様の3.3.2節にあるエラーテーブルと比較します。問題を再現するには tests/compatibility/core_operations/test_task_lifecycle.py::TestCancelTask::test_cancel_terminal_task_returns_error[http_json] を実行します。期待される結果は、コード400、理由TASK_NOT_CANCELABLEを含むHTTP 400のレスポンスです。
索引モデルが issue の本文から書いたものです。
説明
Summary
When canceling a task that is already in a terminal state (TASK_STATE_COMPLETED), the HTTP+JSON transport returns 409 Conflict instead of 400 Bad Request as required by the A2A specification's error mapping table.
Requirement
- ID: CORE-CANCEL-002
- Section: 3.1.5 — CancelTask returns TaskNotCancelableError for terminal tasks
- Level: MUST
- Spec: https://github.com/a2aproject/A2A/blob/3303592588e388e62e0f69f701af531d2f4e3991/docs/specification.md#315-cancel-task
Specification
CancelTask MUST return TaskNotCancelableError when the task is not in a cancelable state (already completed, failed, or canceled).
The error mapping table in section 3.3.2 specifies:
| Error Name | JSON-RPC | gRPC | HTTP |
|---|---|---|---|
TaskNotCancelableError |
-32002 |
FAILED_PRECONDITION |
400 Bad Request |
Expected behavior
The HTTP+JSON transport should return HTTP status 400 Bad Request with an AIP-193 error body containing "code": 400 and an ErrorInfo detail with "reason": "TASK_NOT_CANCELABLE".
Actual behavior
The SUT returns HTTP 409 Conflict with "code": 409 and "status": "FAILED_PRECONDITION":
{
"error": {
"code": 409,
"status": "FAILED_PRECONDITION",
"message": "Task cannot be canceled - current state: TASK_STATE_COMPLETED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "TASK_NOT_CANCELABLE",
"domain": "a2a-protocol.org",
"metadata": {}
}
]
}
}
Note: The reason and error structure are correct — only the HTTP status code is wrong.
Reproducer
# 1. Create a task that completes immediately
TASK_ID=$(curl -s -X POST "http://localhost:9999/message:send" \
-H "Content-Type: application/json" \
-H "A2A-Version: 1.0" \
-d '{"message":{"role":"ROLE_USER","parts":[{"text":"TCK prerequisite task creation"}],"messageId":"tck-complete-task-repro"},"configuration":{"acceptedOutputModes":["text"]}}' \
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d['task']['id'])")
# 2. Verify the task is completed
curl -s -X GET "http://localhost:9999/tasks/$TASK_ID" \
-H "A2A-Version: 1.0" \
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d['status']['state'])"
# → TASK_STATE_COMPLETED
# 3. Attempt to cancel the completed task (expect 400, get 409)
curl -s -w "\nHTTP Status: %{http_code}\n" -X POST "http://localhost:9999/tasks/$TASK_ID:cancel" \
-H "A2A-Version: 1.0"
# → HTTP Status: 409 (should be 400)
TCK test
tests/compatibility/core_operations/test_task_lifecycle.py::TestCancelTask::test_cancel_terminal_task_returns_error[http_json]
- 主要言語
- Java
- スター
- 510
- フォーク
- 196
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 57
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
a2aproject/a2a-java のほかの issue
-
fix: handle blank push notification config id consistently across transports対応中かも @prachisinghal-1 が 15 日前に担当しました。 オープン
難易度 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 が 382 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンsample
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
a2aproject/a2a-java#375 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
a2aproject/a2a-java#1299 ·
メンテナーはふだん 1 日以内に返信
-
Task state transitions are not tracked再び着手できるかも @sumitvairagar が 21 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
a2aproject/a2a-java#1222 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
a2aproject/a2a-java の issue をすべて見る
似ている issue
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
-
bug subsystem:agent-harness triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ShaftHQ/SHAFT_ENGINE#7797 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
NationalSecurityAgency/ghidra#10155 ·
メンテナーはふだん 2 日以内に返信
-
area:data coverage
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
reacher-z/Awesome-CUA#4864 ·
メンテナーはふだん 19 日以内に返信
-
bug web-ui
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
jenkinsci/jenkins#27705 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信