Commit 3e61e57
fix(bigquery): address PR google#1344 review — flush/close coordination, HITL pair keys, fail-closed redaction, atomic finalize gate, per-operation tool spans
Resolves all five review findings on the previous commit:
1. BatchProcessor.close() now waits (bounded by the same shutdownTimeout
deadline) for an in-flight flush to release the flush lock before
tearing down the writer and Arrow resources, instead of treating an
empty queue as proof that no flush is active.
2. HITL_*_COMPLETED rows (both the event path and the user-message path)
now carry pause_kind and function_call_id, so completions are joinable
to their HITL_*_REQUEST / TOOL_PAUSED rows when multiple HITL requests
share an invocation.
3. New JsonFormatter.redactTree replaces the smartTruncate-based
attributes boundary: raw containers are walked natively with keys
redacted before any Jackson conversion, and an unserializable leaf
becomes "[UNSERIALIZABLE]" instead of routing the whole map through
the textual fallback that exposed sibling secrets. JsonNode leaves are
handled before the Iterable branch (ObjectNode iterates its values).
4. The invocation-finalization gate is now atomic: the isProcessed check
runs inside computeIfAbsent's mapping function under the per-key lock,
paired with finalize's mark-before-remove ordering; the residual
tombstone-cache-expiry window is documented.
5. Tool spans carry an operation identity (ToolContext.functionCallId)
and a parent captured at push time: ADK runs an event's function calls
concurrently by default within one branch, so TOOL_STARTING rows are
stamped from the pushed record, completions/errors pop by identity
rather than stack position, and parents skip concurrent siblings.
Tests: 160 focused BQAA tests pass (previous commit: 153), full core
suite 1,616 passed / 0 failed. New coverage: close-waits-for-in-flight-
flush, per-leaf fail-closed redaction (including nested containers and
converted POJO leaves), HITL completion pair keys on both paths, and
same-branch concurrent tools with out-of-order identity pops.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent e9b4073 commit 3e61e57
9 files changed
Lines changed: 474 additions & 48 deletions
File tree
- core/src
- main/java/com/google/adk/plugins/agentanalytics
- test/java/com/google/adk/plugins/agentanalytics
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
328 | 348 | | |
329 | 349 | | |
330 | 350 | | |
| |||
Lines changed: 64 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
352 | 351 | | |
353 | 352 | | |
354 | 353 | | |
| |||
414 | 413 | | |
415 | 414 | | |
416 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
417 | 429 | | |
418 | 430 | | |
419 | 431 | | |
| |||
569 | 581 | | |
570 | 582 | | |
571 | 583 | | |
572 | | - | |
| 584 | + | |
| 585 | + | |
573 | 586 | | |
574 | 587 | | |
575 | 588 | | |
576 | 589 | | |
577 | 590 | | |
578 | 591 | | |
579 | 592 | | |
580 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
581 | 597 | | |
582 | 598 | | |
583 | 599 | | |
| |||
683 | 699 | | |
684 | 700 | | |
685 | 701 | | |
686 | | - | |
| 702 | + | |
| 703 | + | |
687 | 704 | | |
688 | | - | |
| 705 | + | |
689 | 706 | | |
690 | 707 | | |
691 | 708 | | |
692 | 709 | | |
693 | 710 | | |
694 | 711 | | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
| 712 | + | |
699 | 713 | | |
700 | | - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
701 | 719 | | |
702 | 720 | | |
703 | 721 | | |
| |||
1040 | 1058 | | |
1041 | 1059 | | |
1042 | 1060 | | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
1047 | 1079 | | |
1048 | 1080 | | |
1049 | 1081 | | |
| |||
1061 | 1093 | | |
1062 | 1094 | | |
1063 | 1095 | | |
1064 | | - | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
1065 | 1099 | | |
1066 | 1100 | | |
1067 | 1101 | | |
| |||
1072 | 1106 | | |
1073 | 1107 | | |
1074 | 1108 | | |
1075 | | - | |
1076 | | - | |
1077 | 1109 | | |
1078 | 1110 | | |
1079 | 1111 | | |
1080 | 1112 | | |
1081 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
1082 | 1116 | | |
1083 | | - | |
| 1117 | + | |
1084 | 1118 | | |
1085 | 1119 | | |
1086 | 1120 | | |
| |||
1102 | 1136 | | |
1103 | 1137 | | |
1104 | 1138 | | |
1105 | | - | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1106 | 1142 | | |
1107 | 1143 | | |
1108 | 1144 | | |
| |||
1112 | 1148 | | |
1113 | 1149 | | |
1114 | 1150 | | |
1115 | | - | |
1116 | | - | |
1117 | 1151 | | |
1118 | 1152 | | |
1119 | 1153 | | |
1120 | 1154 | | |
1121 | 1155 | | |
1122 | 1156 | | |
| 1157 | + | |
| 1158 | + | |
1123 | 1159 | | |
1124 | | - | |
| 1160 | + | |
1125 | 1161 | | |
1126 | 1162 | | |
1127 | 1163 | | |
| |||
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
89 | 167 | | |
90 | 168 | | |
91 | 169 | | |
| |||
Lines changed: 44 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | 226 | | |
233 | 227 | | |
234 | | - | |
| 228 | + | |
235 | 229 | | |
236 | 230 | | |
237 | 231 | | |
| |||
240 | 234 | | |
241 | 235 | | |
242 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
246 | 283 | | |
247 | 284 | | |
248 | 285 | | |
| |||
0 commit comments