Commit ad560ce
fix: Default subagents to chat mode in build_node
* Dynamically attached subagents bypass LlmAgent.model_post_init normalization and retain mode=None.
* Previously, build_node defaulted all mode=None agents to single_turn, preventing agent transfer and causing duplicate output errors.
* Now, build_node checks for agent.parent_agent to identify subagents and defaults them to chat mode, preserving single_turn only for standalone nodes.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 9294718031 parent 4bd9454 commit ad560ce
2 files changed
Lines changed: 24 additions & 1 deletion
File tree
- src/google/adk/workflow/utils
- tests/unittests/workflow/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
0 commit comments