GoogleCloudPlatform / GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK
adk-2.0 producer: enrich originating-Event rows with attributes.adk.branch
- 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).
## Contract
Stamp `attributes.adk.branch` on every **originating-Event** row when `event.branch` is set on the source. The existing plugin captures `event.branch` at `bigquery_agent_analytics_plugin.py:3118` for `AGENT_RESPONSE` only; this issue extends it to all originating-Event rows produced through `_log_event`.
**Scope**: Event-originating rows only. Callback-originating lifecycle rows (`LLM_REQUEST`, `LLM_RESPONSE`, tool rows from `before_model` / `after_model` / `before_tool` / `after_tool`) do **not** carry `attributes.adk.branch` under this issue — they have no source `Event` per #194's coverage matrix. If callback-row branch coverage is needed later, file a separate enhancement that broadens `EventData` to propagate `InvocationContext.branch` to all rows.
## Acceptance
- [ ] Every originating-Event row carries `attributes.adk.branch` when `event.branch` is set on the source.
- [ ] Originating-Event rows where `event.branch` is null leave the field null (no synthetic value).
- [ ] Pre-2.0 rows and non-Event-originating callback rows leave the field null (best-effort).
- [ ] A multi-agent fixture demonstrates the field appears on the originating-Event rows ADK actually produces for a branched run (`AGENT_RESPONSE`, `STATE_DELTA`, etc.), not on `before_model` / `before_tool` lifecycle rows.
## References
- #190 (v15 producer §2).
- `src/google/adk/plugins/bigquery_agent_analytics_plugin.py:3118` (existing `AGENT_RESPONSE`-only capture).
- #194 (per-callback coverage matrix for the source-event plumbing).
Contributor guide
Assessment
This issue has not been assessed yet.