GoogleCloudPlatform / GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK

adk-2.0 producer: emit AGENT_STATE_CHECKPOINT from actions.agent_state OR end_of_agent

Open
#202 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
47
Forks
21
Avg merge
2d 13h
Merged PRs (30d)
33

Description

Parent tracker: #190 (v15 contract).
Wave: 2 — Producer event rows.
Blocked by: #194 (EventData source-event plumbing).
Design dependency: oversized AGENT_STATE_CHECKPOINT offload contract (Wave 3 design issue).

## Contract

Trigger condition: **fire when either `event.actions.agent_state is not None` or `event.actions.end_of_agent is True`** — independently. ADK's `_create_agent_state_event` can produce either field on its own, and the docstring on `EventActions.end_of_agent` notes there can be multiple `end_of_agent=True` events for the same agent within a loop.

Content shape: `{end_of_agent: bool, agent_state: dict|null}`. Allow `{agent_state: null, end_of_agent: true}` payloads.

**Oversized snapshots**: the GCS offload contract (URI placement, SHA-256, inline removal/replacement, helper sharing) is deferred to the Wave 3 design issue. This issue handles the inline case only until that design lands.

## Acceptance

- [ ] `AGENT_STATE_CHECKPOINT` fires for `{agent_state: null, end_of_agent: true}`.
- [ ] `AGENT_STATE_CHECKPOINT` fires for `{agent_state: {...}, end_of_agent: false}`.
- [ ] Multiple checkpoints in a loop (multiple `end_of_agent=True`) all produce rows.
- [ ] Snapshots above `BQAA_AGENT_STATE_MAX_BYTES` are deferred to the offload design issue (this issue does not attempt to ship oversized handling).

## References

- #190 (v15 producer §5).
- `src/google/adk/events/event_actions.py:102` (`end_of_agent`), `:107` (`agent_state`).

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.