Commit 236b790
committed
fix(bqaa): put C7 pair keys under attributes.adk (not top-level)
Caught in review of #6: the C7 pair keys
(pause_kind, function_call_id) were being passed via
EventData.extra_attributes, which _enrich_attributes() copies at the
top of attrs *before* attrs["adk"] = _build_adk_envelope(...). That
landed them at attributes.pause_kind / attributes.function_call_id,
not attributes.adk.pause_kind / attributes.adk.function_call_id.
The customer SQL pinned in google#293 v5 acceptance #3 is:
JSON_VALUE(attributes, '$.adk.function_call_id') = JSON_VALUE(...)
so the pair join would have returned null on every row. This commit
makes the contract match the SQL.
Changes:
* EventData gains adk_extras: dict[str, Any], a sibling of
extra_attributes that lives INSIDE attributes.adk.
* _enrich_attributes merges adk_extras into the envelope after
_build_adk_envelope (envelope wins on conflict — producer-derived
identity fields like source_event_id are the source of truth).
* The two emit sites (TOOL_PAUSED in on_event_callback,
TOOL_COMPLETED in on_user_message_callback) pass the pair keys via
adk_extras= instead of extra_attributes=.
* The three C7 tests are updated to assert
json.loads(row["attributes"])["adk"]["pause_kind"] etc., locking
in the right shape this time.
Full plugin suite: 252 passed.1 parent 119b8ea commit 236b790
2 files changed
Lines changed: 27 additions & 13 deletions
File tree
- src/google/adk/plugins
- tests/unittests/plugins
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2020 | 2020 | | |
2021 | 2021 | | |
2022 | 2022 | | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
2023 | 2029 | | |
2024 | 2030 | | |
2025 | 2031 | | |
| |||
2923 | 2929 | | |
2924 | 2930 | | |
2925 | 2931 | | |
2926 | | - | |
| 2932 | + | |
2927 | 2933 | | |
2928 | 2934 | | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
2929 | 2943 | | |
2930 | 2944 | | |
2931 | 2945 | | |
| |||
3136 | 3150 | | |
3137 | 3151 | | |
3138 | 3152 | | |
3139 | | - | |
| 3153 | + | |
3140 | 3154 | | |
3141 | 3155 | | |
3142 | 3156 | | |
| |||
3304 | 3318 | | |
3305 | 3319 | | |
3306 | 3320 | | |
3307 | | - | |
| 3321 | + | |
3308 | 3322 | | |
3309 | 3323 | | |
3310 | 3324 | | |
| |||
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8007 | 8007 | | |
8008 | 8008 | | |
8009 | 8009 | | |
8010 | | - | |
8011 | 8010 | | |
8012 | 8011 | | |
8013 | 8012 | | |
| |||
8346 | 8345 | | |
8347 | 8346 | | |
8348 | 8347 | | |
| 8348 | + | |
| 8349 | + | |
8349 | 8350 | | |
8350 | | - | |
8351 | | - | |
8352 | | - | |
| 8351 | + | |
| 8352 | + | |
8353 | 8353 | | |
8354 | 8354 | | |
8355 | 8355 | | |
| |||
8379 | 8379 | | |
8380 | 8380 | | |
8381 | 8381 | | |
8382 | | - | |
8383 | | - | |
8384 | | - | |
| 8382 | + | |
| 8383 | + | |
| 8384 | + | |
8385 | 8385 | | |
8386 | 8386 | | |
8387 | 8387 | | |
| |||
8407 | 8407 | | |
8408 | 8408 | | |
8409 | 8409 | | |
8410 | | - | |
8411 | | - | |
8412 | | - | |
| 8410 | + | |
| 8411 | + | |
| 8412 | + | |
8413 | 8413 | | |
8414 | 8414 | | |
8415 | 8415 | | |
| |||
0 commit comments