google / google/adk-web

Advanced Tool Confirmation UI cannot collect editable payload input

Open
#463 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1k
Forks
267
Avg merge
1d 12h
Merged PRs (30d)
9

Description

## Summary

When using Advanced Tool Confirmation through `ToolContext.request_confirmation(hint=..., payload=...)`, the current ADK Web interface displays:

- the confirmation hint;
- a read-only JSON payload viewer;
- a `Confirmed` checkbox;
- a Submit button.

It does not provide an editable text field, JSON editor, or generated form that allows the human user to enter or modify the requested confirmation payload.

As a result, the standard ADK Web interface appears unable to collect the structured human input described in the Advanced Tool Confirmation
documentation.

## Environment

- `google-adk`: `1.34.x` (also observed in 2.x)
- Exact version: `[paste output from pip show google-adk]`
- Python: `3.10`
- Operating system: `macOS`
- UI: bundled `adk web`
- Installation method: `uv` or `pip`

## Minimal reproduction

```python
from typing import Any

from google.adk.agents import Agent
from google.adk.tools.tool_context import ToolContext

def collect_user_name(
tool_context: ToolContext,
) -> dict[str, Any]:
confirmation = tool_context.tool_confirmation

if confirmation is None:
tool_context.request_confirmation(
hint="Please enter your name.",
payload={
"user_name": "",
},
)

return {
"status": "waiting_for_user_input",
}

if not confirmation.confirmed:
return {
"status": "cancelled",
}

payload = confirmation.payload or {}

return {
"status": "success",
"user_name": payload.get("user_name"),
}

root_agent = Agent(
name="advanced_confirmation_reproduction",
model="gemini-2.5-flash",
instruction="""
When asked to collect the user's name, call collect_user_name.
Do not ask for the name directly through an ordinary chat response.
After confirmation resumes, report the user_name returned by the tool.
""",
tools=[collect_user_name],
)
```

Run the agent using:

```bash
adk web
```

Then send:

```text
Please collect my name.
```

## Actual behaviour

ADK Web displays the confirmation hint and a Payload section, but the payload is shown through a read-only JSON viewer.

The only editable control in the `isConfirmationRequest` template branch is:

```html

```

There is no editable control bound to:

```typescript
confirmationModel.payload
```

The relevant template structure is effectively:

```text
if isConfirmationRequest:
display confirmation hint
display read-only JSON viewer
display Confirmed checkbox
display Submit button

else if formFields.length > 0:
display editable schema-generated fields

else:
display generic editable response input
```

Because `adk_request_confirmation` makes `isConfirmationRequest` true, the schema-generated and generic editable-input branches are skipped.

The relevant source file is:

```text
src/app/components/long-running-response/long-running-response.html
```

The dedicated confirmation branch was introduced in:

```text
dd9e8f493eae11035dfb40b4ec2280a01cfd04d8
```

Source:

https://github.com/google/adk-web/blob/dd9e8f493eae11035dfb40b4ec2280a01cfd04d8/src/app/components/long-running-response/long-running-response.html

## Confirmation event

The agent emits an advanced confirmation request containing a payload similar
to:

```json
{
"name": "adk_request_confirmation",
"args": {
"toolConfirmation": {
"hint": "Please enter your name.",
"payload": {
"user_name": ""
}
}
}
}
```

Despite the presence of `toolConfirmation.payload`, ADK Web only allows the user to change the Boolean `confirmed` value.

## Expected behaviour

When an Advanced Tool Confirmation request includes:

```json
{
"user_name": ""
}
```

ADK Web should allow the human user to enter or modify the payload before submitting.

Acceptable implementations could include:

1. a generated form field for each payload property;
2. an editable JSON textarea initialized from `toolConfirmation.payload`;
3. an editable response field compatible with the older pending-event dialog.

Submitting should produce a response such as:

```json
{
"confirmed": true,
"payload": {
"user_name": "Ashwin"
}
}
```

## Documentation mismatch

The Action Confirmations documentation states that Advanced Confirmation can pause tool execution, request specific information, and resume with the
provided data.

It describes `payload` as the structure of the data expected in return and shows an advanced confirmation dialog with an editable Response field.

Documentation:

https://adk.dev/tools-custom/confirmation/

The UI bundled with `google-adk==1.34.x` instead exposes only Boolean user
interaction for `adk_request_confirmation`.

If editable structured confirmation input is not intended to be supported by ADK Web, the documentation should explicitly state that a custom UI, REST client, or another response channel is required.

## Historical behaviour / possible regression

Older ADK Web versions used a generic pending-event response dialog containing an editable Response textarea.

For example, `google/adk-python#3645`, reported with
`google-adk==1.19.0`, shows a user manually entering:

```json
{
"confirmed": true,
"payload": {
"user_name": "ashwin"
}
}
```

Related report:

https://github.com/google/adk-python/issues/3645

The old dialog was later removed and replaced with an inline response component:

https://github.com/google/adk-web/commit/a2a337dd69516b552743d177fb9497eeaa0acea7

A subsequent change introduced the dedicated `adk_request_confirmation` checkbox branch:

https://github.com/google/adk-web/commit/dd9e8f493eae11035dfb40b4ec2280a01cfd04d8

The newer branch appears to bypass the existing editable response paths.

## Relationship to #439 and PR #440

This issue is related to, but distinct from:

- https://github.com/google/adk-web/issues/439
- https://github.com/google/adk-web/pull/440

Issue #439 reports that `confirmationModel.payload` is initialized from:

```typescript
originalFunctionCall.args
```

instead of:

```typescript
toolConfirmation.payload
```

PR #440 proposes correcting the source used to initialize the automatically submitted payload.

However, even after that proposed change, there is still no editable control bound to `confirmationModel.payload`. The UI would submit the initial payload without allowing the human user to supply or modify the requested values.

This issue specifically concerns the absence of an editable payload input for Advanced Tool Confirmation.

## Impact

This blocks developers who:

- use the standard ADK Web interface;
- define agents and tools but do not own the runner or frontend;
- need arbitrary or structured human input rather than Boolean approval;
- operate in managed or enterprise environments where custom frontend changes
are not available.

In these environments, Advanced Tool Confirmation cannot be used for its documented structured-input purpose from the agent definition alone.

## Suggested resolution

Please consider one of the following:

1. Render editable fields generated from `toolConfirmation.payload`.
2. Add an editable JSON textarea bound to `confirmationModel.payload`.
3. Allow the generic response-schema form branch to handle advanced
confirmation payloads.
4. Document clearly that ADK Web supports Boolean confirmation only and that
structured payload input requires a custom client.

Contributor guide

Open the contributing guide

Research direction

Reproduce the confirmation flow with the provided Python agent and `adk web`, then inspect `src/app/components/long-running-response/long-running-response.html` and the existing response component paths. The work is done when an Advanced Tool Confirmation payload can be edited and submitted so the resulting confirmation includes the user-supplied payload values.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.