Commit 41d6c61
authored
.NET fix: Synthesized Handoff FunctionResult is never sent to agent (#5718)
* test: Split out Handoff Orchestration tests
* fix: Synthesized Handoff FunctionResult is never sent to agent
When we receive a handoff request from the agent, we need to service it outside of the Agent Loop to terminate the loop. What this means is that we take ownership of terminating the call by feeding the result back into the agent on a subsequent invocation.
When we refactored Handoff to support HITL and make use of AgentSession, we inadvertantly removed this step, causing subsequent invocations to the Handoff agent to fail (first works, but breaks the state).
The fix is to be more precise about the agent's bookmark when concatenating the result of agent invocation to the shared conversation history.
* test: Add unit tests for Handoff FunctionCall/Result matching fix1 parent dfc3079 commit 41d6c61
4 files changed
Lines changed: 1304 additions & 922 deletions
File tree
- dotnet
- src/Microsoft.Agents.AI.Workflows/Specialized
- Magentic
- tests/Microsoft.Agents.AI.Workflows.UnitTests
Lines changed: 43 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
270 | 296 | | |
271 | 297 | | |
272 | 298 | | |
| |||
376 | 402 | | |
377 | 403 | | |
378 | 404 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 405 | + | |
389 | 406 | | |
390 | | - | |
391 | | - | |
392 | | - | |
| 407 | + | |
| 408 | + | |
393 | 409 | | |
394 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
395 | 413 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
| 414 | + | |
403 | 415 | | |
404 | | - | |
405 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
406 | 422 | | |
407 | 423 | | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
412 | 427 | | |
413 | 428 | | |
414 | 429 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| |||
0 commit comments