[BUG] HITL ask_user_response: the documented shape is wrong, and a malformed response leaves the task stuck in working
Maintainer thường phản hồi trong vòng 1 ngày
@suryakant-source đang làm issue này rồi.
Từ ngày 23/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- backend-api-design, documentation
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 4.5k
- Fork
- 937
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 150
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của kagent-dev/kagent
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kagent-dev/kagent#3792 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kagent-dev/kagent#3790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
kagent-dev/kagent#3789 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] A2A lookups by task or context ID reveal whether another user's resource existsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
kagent-dev/kagent#3787 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Python memory summarization fails for Gemini models: the request has no model nameCó thể đã có người làm @BahaaMattar đã nhận 7 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kagent-dev/kagent#3710 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của kagent-dev/kagent
Issue tương tự
-
[bug] Explorer trims leading spaces on file namesCó thể đã có người làm @unshade đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
mickael-kerjean/filestash#1033 · 1 bình luận ·
-
Update Tailscale dependency for Android cgo fallback fixCó thể đã có người làm @lozbrown đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] HTTP remote call timeouts can be returned as 500Có thể đã có người làm @XnLemon đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
apache/dubbo-go-pixiu#1096 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
conversation: ConverseAlpha1 and ConverseAlpha2 panic on empty choices or nil function call and return misleading error on scrubber failureCó thể đã có người làm @patelshivani2283-lab đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày