Skip to content

Missing Id generation for Event #871

@aditya-kuna

Description

@aditya-kuna

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:

  1. Configure an agent with a tool that requires confirmation (e.g., using ConfirmationTool)
  2. Run the agent and trigger the tool that requires confirmation
  3. Inspect the generated event in the session
  4. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions