Commit 0947b43
feat(adk): migrate to REASONING events and add encrypted value support (#1411)
* feat(adk): migrate from deprecated THINKING events to REASONING events and add encrypted value support
Migrates the ADK middleware from deprecated THINKING_* events to the newer
REASONING_* event types, and adds support for thought signatures via
REASONING_ENCRYPTED_VALUE events. This brings the ADK integration in line
with the Claude Agent SDK and LangGraph integrations.
Changes:
- Replace ThinkingStart/End and ThinkingTextMessage* events with
ReasoningStart/End and ReasoningMessage* events
- Extract thought_signature from Google GenAI SDK Part objects and emit
as REASONING_ENCRYPTED_VALUE events (base64-encoded)
- Update all internal state tracking variables (_is_thinking -> _is_reasoning, etc.)
- Update comprehensive tests and integration tests to expect REASONING events
- Add new tests for thought signature / encrypted value handling
Closes #1406
https://claude.ai/code/session_01Tn74iGdv36gg9zys3yQaAz
* test(adk): add e2e tests for reasoning message_id consistency, role, encrypted values, and stream ordering
Adds 5 new integration tests (requiring GOOGLE_API_KEY) that validate:
- All reasoning events in a block share the same message_id
- REASONING_MESSAGE_START carries role="reasoning"
- REASONING_ENCRYPTED_VALUE events contain valid base64 thought signatures
with correct entity_id and subtype
- Reasoning stream is fully closed before text message events begin
https://claude.ai/code/session_01Tn74iGdv36gg9zys3yQaAz
* fix(adk): fix e2e tests for multi-block reasoning and require reasoning events
- Reasoning events are now required (not optional) since gemini-2.5-flash
with include_thoughts=True always produces them
- Fix message_id consistency test to validate per-block rather than
globally, since streaming can produce multiple reasoning blocks when
thought/text parts interleave across partial events
- Replace stream-ordering test with well-formedness check that validates
each block is properly opened/closed (START/END balanced, no overlap)
- Add helper _get_reasoning_blocks() to extract START-to-END blocks
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(adk): add reasoning chat example and update changelog for #1406
- Add agentic_chat_reasoning example agent using Gemini 2.5 Flash with
include_thoughts=True, registered at /adk-reasoning-chat
- Update CHANGELOG.md unreleased section to document all changes:
migration from THINKING to REASONING events, encrypted value support,
and the new example
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d70978d commit 0947b43
7 files changed
Lines changed: 531 additions & 230 deletions
File tree
- integrations/adk-middleware/python
- examples/server
- api
- src/ag_ui_adk
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
10 | 19 | | |
11 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
12 | 30 | | |
13 | 31 | | |
14 | 32 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
Lines changed: 95 additions & 60 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
| |||
482 | 484 | | |
483 | 485 | | |
484 | 486 | | |
| 487 | + | |
485 | 488 | | |
486 | 489 | | |
487 | 490 | | |
| |||
499 | 502 | | |
500 | 503 | | |
501 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
502 | 508 | | |
503 | 509 | | |
504 | 510 | | |
505 | | - | |
| 511 | + | |
506 | 512 | | |
507 | | - | |
| 513 | + | |
508 | 514 | | |
509 | 515 | | |
510 | 516 | | |
511 | 517 | | |
512 | 518 | | |
513 | | - | |
| 519 | + | |
514 | 520 | | |
515 | 521 | | |
516 | 522 | | |
| |||
523 | 529 | | |
524 | 530 | | |
525 | 531 | | |
526 | | - | |
| 532 | + | |
527 | 533 | | |
528 | 534 | | |
529 | 535 | | |
| |||
606 | 612 | | |
607 | 613 | | |
608 | 614 | | |
609 | | - | |
| 615 | + | |
610 | 616 | | |
611 | 617 | | |
612 | 618 | | |
| |||
660 | 666 | | |
661 | 667 | | |
662 | 668 | | |
663 | | - | |
| 669 | + | |
664 | 670 | | |
665 | | - | |
| 671 | + | |
| 672 | + | |
666 | 673 | | |
667 | | - | |
| 674 | + | |
668 | 675 | | |
669 | | - | |
670 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
671 | 679 | | |
672 | 680 | | |
673 | 681 | | |
| 682 | + | |
| 683 | + | |
674 | 684 | | |
675 | 685 | | |
676 | | - | |
| 686 | + | |
| 687 | + | |
677 | 688 | | |
678 | 689 | | |
679 | 690 | | |
| |||
682 | 693 | | |
683 | 694 | | |
684 | 695 | | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
691 | 703 | | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
700 | 716 | | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
708 | 725 | | |
709 | | - | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
710 | 741 | | |
711 | | - | |
712 | | - | |
| 742 | + | |
| 743 | + | |
713 | 744 | | |
714 | | - | |
| 745 | + | |
715 | 746 | | |
716 | 747 | | |
717 | 748 | | |
718 | | - | |
| 749 | + | |
719 | 750 | | |
720 | | - | |
721 | | - | |
722 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
723 | 755 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
731 | 764 | | |
732 | | - | |
733 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
734 | 768 | | |
735 | 769 | | |
736 | 770 | | |
| |||
1164 | 1198 | | |
1165 | 1199 | | |
1166 | 1200 | | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
1171 | 1206 | | |
1172 | 1207 | | |
1173 | 1208 | | |
| |||
0 commit comments