[BUG] HITL ask_user_response: the documented shape is wrong, and a malformed response leaves the task stuck in working
メンテナーはふだん 1 日以内に返信
@suryakant-source がすでに取り組んでいます。
2026年10月23日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
調査の方向性
Start with go/api/a2a/hitl.go and docs/architecture/human-in-the-loop.md, then trace how SendMessage validates and dispatches HITL responses before task input is persisted. Check how malformed payloads affect task state and how existing tests cover both response types. Done means malformed responses are rejected while the task remains input-required, and the docs show the exact JSON shapes for both response types.
索引モデルが issue の本文から書いたものです。
説明
Bug description
Two related problems with HITL ask_user_response:
-
The docs describe the wrong shape.
docs/architecture/human-in-the-loop.mdsays responses carry "ananswersarray whose entries contain string arrays", which reads as"answers": [["Blue"]]. The type ingo/api/a2a/hitl.gois:type AskUserAnswer struct { Answer []string `json:"answer"` }So the wire shape is
"answers": [{"answer": ["Blue"]}]. -
A response in the documented shape strands the task instead of being rejected. The gateway accepts the message and the session moves the task to
working. Decoding then fails in the runtime, but the task staysworkingand never settles; onlyCancelTaskgets it out. The doc's own promise ("The server rejects responses that use the wrong task/context, omit required decisions, …") suggests malformed responses should be refused up front.
Steps to reproduce
- A Claude harness agent calls
AskUserQuestion. The task isTASK_STATE_INPUT_REQUIREDwith anask_user_requestin the status metadata. SendMessageto the same task and context, withextensions: ["https://kagent.dev/extensions/hitl/v1"]and metadata:{"https://kagent.dev/extensions/hitl/v1": {"type": "ask_user_response", "id": "<request id>", "answers": [["Blue"]]}}
Expected
An InvalidParams-style error, with the task still input-required so a corrected answer can follow.
Actual
The first call returns:
-32603 decode ask-user response: json: cannot unmarshal array into AskUserResponse.answers.0 of type a2a.AskUserAnswer
GetTask then reports TASK_STATE_WORKING indefinitely. A corrected answer ([{"answer": ["Blue"]}]) is refused with resource conflict because the task is no longer pending. The task has to be cancelled.
With the correct shape everything works: the agent resumes immediately.
Suggested fix
- Validate the HITL payload before the input is persisted or dispatched, and reject it with the task left
input-required. - Show the exact JSON for
ask_user_responseandtool_approval_responsein the doc.
Environment
kagent v1.0.0-alpha17, Claude harness (Claude Code 2.1.285), A2A v1 JSON-RPC.
- 主要言語
- Go
- スター
- 4.5k
- フォーク
- 937
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 150
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
kagent-dev/kagent のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
kagent-dev/kagent#3792 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kagent-dev/kagent#3790 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
kagent-dev/kagent#3789 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] A2A lookups by task or context ID reveal whether another user's resource exists対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
kagent-dev/kagent#3787 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Python memory summarization fails for Gemini models: the request has no model name対応中かも @BahaaMattar が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
kagent-dev/kagent#3710 ·
メンテナーはふだん 1 日以内に返信
kagent-dev/kagent の issue をすべて見る
似ている issue
-
[bug] Explorer trims leading spaces on file names対応中かも @unshade が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
mickael-kerjean/filestash#1033 · コメント 1 件 ·
-
Update Tailscale dependency for Android cgo fallback fix対応中かも @lozbrown が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
[BUG] HTTP remote call timeouts can be returned as 500対応中かも @XnLemon が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
apache/dubbo-go-pixiu#1096 ·
メンテナーはふだん 1 日以内に返信
-
conversation: ConverseAlpha1 and ConverseAlpha2 panic on empty choices or nil function call and return misleading error on scrubber failure対応中かも @patelshivani2283-lab が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信