Commit 9dec085
fix: Prevent fan-out when functional and handoff tools coexist on same node
A static loop-back edge from the tools node conflicted with Command(goto=child)
emitted by handoff tools, causing both to fire as a fan-out. Fix by replacing
the static edge with a conditional edge in the mixed case: after the ToolNode
runs, route back to the parent only when the last message is from a functional
tool; route to END when it is from a handoff (Command already handles routing
to the target agent).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f0cccd1 commit 9dec085
1 file changed
Lines changed: 27 additions & 8 deletions
File tree
- packages/ai-providers/server-ai-langchain/src/ldai_langchain
Lines changed: 27 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | 187 | | |
191 | 188 | | |
192 | 189 | | |
| |||
199 | 196 | | |
200 | 197 | | |
201 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
202 | 207 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
208 | 227 | | |
209 | 228 | | |
210 | 229 | | |
| |||
0 commit comments