Commit db17679
committed
fix: Pre-merge stateDelta before onUserMessageCallback (#1099)
The stateDelta was not merged into session state before onUserMessageCallback was invoked, causing plugins to see null values when reading caller-provided state entries.
This fix pre-merges stateDelta into the session's in-memory state before creating the InvocationContext. Since the session is already a copy from getSession(), this is safe and does not affect the persistence path which still happens via EventActions in appendNewMessageToSession.
Added test: onUserMessageCallback_withStateDelta_seesMergedState1 parent 88eb0f5 commit db17679
2 files changed
Lines changed: 38 additions & 0 deletions
File tree
- core/src
- main/java/com/google/adk/runner
- test/java/com/google/adk/runner
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
451 | 457 | | |
452 | 458 | | |
453 | 459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
880 | 912 | | |
881 | 913 | | |
882 | 914 | | |
| |||
0 commit comments