-
Notifications
You must be signed in to change notification settings - Fork 282
Description
Describe the Bug:
Events generated for tool confirmation requests (adk_request_confirmation) are being created with null IDs. This occurs when tools require user confirmation before execution. The root cause is that Functions.generateRequestConfirmationEvent() creates events without calling .id(Event.generateEventId()), resulting in events being persisted to session storage with id: null.
Steps to Reproduce:
- Configure an agent with a tool that requires confirmation (e.g., using ConfirmationTool)
- Run the agent and trigger the tool that requires confirmation
- Inspect the generated event in the session
- Observe that the event has "id": null
Expected Behavior:
All events should have a unique, non-null ID generated via Event.generateEventId().
Observed Behavior:
Event object is being created with "null" id
Environment Details:
- ADK Library Version: 0.5.0 (current main branch)
- OS: All platforms (Java-based issue)
- Java Version: N/A (code issue)
Model Information:
- Model agnostic
Minimal Reproduction Code:
https://github.com/google/adk-java/blob/main/core/src/main/java/com/google/adk/flows/llmflows/Functions.java
method - generateRequestConfirmationEvent
return Optional.of(
Event.builder() //missing id
.invocationId(invocationContext.invocationId())
.author(invocationContext.agent().name())
.branch(invocationContext.branch())
.content(contentBuilder.build())
.longRunningToolIds(longRunningToolIds)
.build());
How often has this issue occurred?:
Always