Web UI sends tool args instead of confirmation payload, crashing the agent
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start in long-running-response.ts and inspect initForm(), then follow onSend() to see how confirmationModel.payload becomes the submit request. Verify that the confirmation form uses toolConfirmation.payload when present, falls back to the original function arguments when it is absent, and no longer sends the wrong payload for the documented request_time_off flow.
Written by the indexing model from the issue text.
Description
Bug
I was following the official docs at https://adk.dev/tools-custom/confirmation/#confirmation-definition
to implement a custom confirmation flow using tool_context.request_confirmation(payload={...}).
After implementing it, I noticed that when submitting the confirmation form, the agent
receives the tool's original args instead of the payload schema I specified, causing a
KeyError crash.
Reproduce
def request_time_off(days: int, tool_context: ToolContext):
tool_confirmation = tool_context.tool_confirmation
if not tool_confirmation:
tool_context.request_confirmation(
payload={'approved_days': days},
)
return {'status': 'pending'}
payload = tool_confirmation.payload or {}
approved_days = payload['approved_days'] # KeyError here
- Run
adk web - Trigger
request_time_offwithdays=4 - Submit the confirmation form
- Agent crashes with
KeyError: 'approved_days'because the submitted payload is{ "days": 4 }instead of{ "approved_days": 4 }
Root Cause
adk-python (functions.py) correctly sends both originalFunctionCall and
toolConfirmation (including payload) in the event. The bug is in
long-running-response.ts where initForm() initializes confirmationModel.payload
from originalFunctionCall.args instead of toolConfirmation.payload. Since onSend()
reads confirmationModel.payload to build the submit request, the wrong payload gets sent.
Proposed Fix
// long-running-response.ts
this.confirmationModel.payload = JSON.stringify(
this.functionCall.args?.toolConfirmation?.payload ??
this.functionCall.args?.originalFunctionCall?.args ??
{}, null, 2
);
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 266
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/adk-web
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100