fix(kagent-adk): surface the sub-agent's ask_user question in remote_hitl_hint - #2495
Merged
EItanya merged 1 commit intoAug 19, 2026
Conversation
…hitl_hint remote_hitl_hint() in the Python kagent-adk runtime only ever listed the paused tool's name (e.g. "ask_user"), never the actual question text, even though AskUserRequest.questions already carries it (set directly on the request in build_hitl_status_message, whether or not nested is populated). A human relaying a bubbled-up sub-agent HITL pause saw "requires approval for tool(s): ask_user" with no way to know what was actually being asked. This mirrors the same fix already made in go/adk/pkg/a2a/hitl.go (kagent-dev#2475) for the Go runtime's RemoteHitlHint(); the two runtimes maintain independent implementations of this hint logic and the Python side never had question-surfacing added. Fixes kagent-dev#2473 Signed-off-by: Vivien Ramahandry <56304555+vramahandry@users.noreply.github.com>
supreme-gg-gg
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
remote_hitl_hint()in the Pythonkagent-adkruntime builds the hint text shown to a human when a sub-agent's own HITL pause bubbles up to the parent agent. Unlike the Go runtime'sRemoteHitlHint(), it only ever lists the paused tool's name (e.g.ask_user) — never the actual question — even thoughAskUserRequest.questions(set directly on the request inbuild_hitl_status_message, whether or notnestedis populated) has the real content right there."Remote agent 'github_agent' requires approval for tool(s): ask_user""Remote agent 'github_agent' asks: What is the GitHub owner/org for the repo?"Real tool-approval hints (the non-
ask_usercase) are unaffected.This is the Python-runtime counterpart to #2475, which fixed the same class of bug in
go/adk/pkg/a2a/hitl.go. The Go and Python runtimes maintain independent implementations of this HITL hint logic, and the Python side never had question-surfacing added — so a parent agent built onkagent-adkstill drops the question today even after #2475 merges.Unlike the Go fix, there's no
[]anyvs[]map[string]any]JSON-decode subtlety to worry about here: Pydantic'sHitlTool.args: dict[str, Any]keeps nested question dicts intact, so readingAskUserRequest.questionsdirectly is straightforward in both the direct and nested case.Fixes #2473
Changes
python/packages/kagent-adk/src/kagent/adk/_hitl.py:remote_hitl_hint()now checksAskUserRequest.questionsfirst and returns"Remote agent '{name}' asks: {question}"when present, falling back to the existing tool-name-only wording otherwise.python/packages/kagent-adk/tests/unittests/test_hitl.py: addstest_remote_hitl_hint_tool_approval,test_remote_hitl_hint_ask_user, andtest_remote_hitl_hint_ask_user_nested(the last covering a two-level nestedask_userpause).Test plan
uv run pytest packages/kagent-adk/tests/unittests/test_hitl.py— 18 passed (3 new)uv run ruff format --diff/uv run ruff check— clean