Commit 96a0749
committed
refactor: use CallbackPipeline consistently in all callback execution sites
Address bot feedback (round 4) by replacing all manual callback iterations
with CallbackPipeline.execute() for consistency and maintainability.
Changes (9 locations):
1. base_agent.py: Use CallbackPipeline for before/after agent callbacks
2. callback_pipeline.py: Optimize single plugin callback execution
3. base_llm_flow.py: Use CallbackPipeline for before/after model callbacks
4. functions.py: Use CallbackPipeline for all tool callbacks (async + live)
Impact:
- Eliminates remaining manual callback iteration logic (~40 lines)
- Achieves 100% consistency in callback execution
- All sync/async handling and early exit logic centralized
- Tests: 24/24 passing
- Lint: 9.57/10 (improved from 9.49/10)
#non-breaking1 parent aaf3c19 commit 96a0749
File tree
4 files changed
+42
-57
lines changed- src/google/adk
- agents
- flows/llm_flows
4 files changed
+42
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
429 | 430 | | |
430 | 431 | | |
431 | 432 | | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
440 | 437 | | |
441 | 438 | | |
442 | 439 | | |
| |||
487 | 484 | | |
488 | 485 | | |
489 | 486 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
498 | 491 | | |
499 | 492 | | |
500 | 493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
833 | 834 | | |
834 | 835 | | |
835 | 836 | | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
844 | 843 | | |
845 | 844 | | |
846 | 845 | | |
| |||
891 | 890 | | |
892 | 891 | | |
893 | 892 | | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
902 | 899 | | |
903 | 900 | | |
904 | 901 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
355 | | - | |
356 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
357 | 360 | | |
358 | 361 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | 362 | | |
364 | 363 | | |
365 | 364 | | |
| |||
393 | 392 | | |
394 | 393 | | |
395 | 394 | | |
396 | | - | |
397 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | 404 | | |
408 | 405 | | |
409 | 406 | | |
| |||
525 | 522 | | |
526 | 523 | | |
527 | 524 | | |
528 | | - | |
529 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
530 | 529 | | |
531 | 530 | | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | 531 | | |
537 | 532 | | |
538 | 533 | | |
| |||
546 | 541 | | |
547 | 542 | | |
548 | 543 | | |
549 | | - | |
550 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
551 | 548 | | |
552 | 549 | | |
553 | 550 | | |
554 | 551 | | |
555 | 552 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | 553 | | |
561 | 554 | | |
562 | 555 | | |
| |||
0 commit comments