google / google/adk-python

A before_agent_callback which changes the state results in an empty Event being returned

Open
#7,078 11 comments 0 reactions 1 assignee Claimed by @surajksharma07 View on GitHub
agent engine request clarification
Dominant language
Python
Stars
21.5k
Forks
4k
Avg merge
1d 14h
Merged PRs (30d)
37

Description

[This code](https://github.com/google/adk-python/blob/54274cdeba42a46e4346f48589c84fe2ebcc0da2/src/google/adk/agents/base_agent.py#L559) forces the end of the turn and results in an empty event being returned if there are state changes.

This prevents these callbacks from doing any kind of processing that result in state changes. It's not clear what's the purpose of this logic. This behavior is [not documented](https://adk.dev/callbacks/types-of-callbacks/#before-agent-callback).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.