-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
When running the ADK using a session database (session store), the usage_metadata field is not being persisted.
This happens even though the model returns response normally.
Expected behavior
The usage_metadata object should be saved in the session entry, just like other session-related fields generated during a run.
Current behavior
The session database entry is created or updated, but the usage_metadata field is always missing.
No errors are thrown during the operation.
Steps to reproduce
1. Configure ADK with a session database (e.g., Firestore, SQL, or other supported backends).
2. Execute any workflow or agent call that returns usage metadata.
3. Inspect the session record in the database.
4. Notice that usage_metadata is not present.
Additional context
• The model usage is correctly returned inside the ADK execution result.
• Only the persistence layer seems to ignore this field during write operations.