Commit 561b968
committed
fix: exit connection cleanly on expected GoAway signal in bidi streaming
Receive the GoAway signal from the Gemini Live API, set a flag on the InvocationContext indicating reconnection is requested, and exit the receive generator cleanly instead of raising a ConnectionClosed exception. This avoids throwing expected session-recycling exceptions into custom client wrappers, which helps prevent false alarms in custom client log monitors.
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 937586604
Change-Id: Ic8d85ecadfd50647c9349dcb4c1a4d53518a76211 parent e72bf9b commit 561b968
2 files changed
Lines changed: 26 additions & 5 deletions
File tree
- src/google/adk/flows/llm_flows
- tests/unittests/flows/llm_flows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
577 | 582 | | |
578 | 583 | | |
579 | 584 | | |
| 585 | + | |
580 | 586 | | |
581 | 587 | | |
582 | 588 | | |
| |||
587 | 593 | | |
588 | 594 | | |
589 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
590 | 599 | | |
591 | 600 | | |
592 | 601 | | |
| |||
667 | 676 | | |
668 | 677 | | |
669 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
670 | 682 | | |
671 | 683 | | |
672 | 684 | | |
| |||
805 | 817 | | |
806 | 818 | | |
807 | 819 | | |
808 | | - | |
809 | | - | |
810 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
811 | 823 | | |
812 | 824 | | |
813 | 825 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
728 | 729 | | |
729 | 730 | | |
730 | 731 | | |
| 732 | + | |
731 | 733 | | |
732 | | - | |
733 | | - | |
| 734 | + | |
| 735 | + | |
734 | 736 | | |
735 | 737 | | |
736 | 738 | | |
737 | 739 | | |
738 | 740 | | |
739 | 741 | | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
740 | 749 | | |
741 | 750 | | |
742 | 751 | | |
| |||
0 commit comments