[dotnet-port-fixes] Execute invocable tool siblings - #930
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-calls-d7ea5478fe3d9fd5
Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
…-calls-d7ea5478fe3d9fd5
Parity Review — PR #930: Execute invocable tool siblingsScope: public API, user-visible behavior Changed Go contract:
Upstream evidence reviewed:
Result: findings reported Parity finding: default enablement diverges from upstreamThe upstream .NET implementation ( The Go port exposes the same behavior as opt-in and default-disabled via This is a meaningful semantic divergence from the upstream fix. The bug being corrected in .NET (#7388) is now fixed unconditionally for .NET users but requires explicit opt-in for Go users, leaving Go callers exposed to the same bug that motivated the fix. Suggested resolution: Either enable
|
There was a problem hiding this comment.
Pull request overview
This PR updates the agent/harness/toolautocall middleware’s function-call loop to support an opt-in mode where invocable local tool calls are still executed even when the same assistant response also includes declaration-only (non-invocable) schema tool calls. It also adds regression tests and updates the .NET vs Go feature comparison docs to reflect the new behavior and configuration.
Changes:
- Add
Config.EnableExecutableFunctionBypassingand integrate an execution-plan step to selectively process invocable function calls in mixed tool-call responses. - Adjust loop termination and assistant/tool-result message handling to support “execute invocable siblings, then stop”.
- Add regression tests for mixed invocable + non-invocable schema tool-call ordering; update feature comparison documentation accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/dotnet-go-sdk-feature-comparison.md | Documents the new opt-in mixed-call handling behavior and notes the intentional divergence from .NET. |
| agent/harness/toolautocall/autocall.go | Implements execution planning for mixed tool-call batches and wires the new config flag through. |
| agent/harness/toolautocall/autocall_test.go | Adds regression tests ensuring default termination behavior and the opt-in sibling-execution behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if len(processable) == 0 { | ||
| return functionCallExecutionPlan{terminate: true} | ||
| } | ||
| return false | ||
| return functionCallExecutionPlan{process: processable, terminate: terminate} | ||
| } |
| // The schema tool was found but it's not invocable. Regardless of TerminateOnUnknownCallRequests, | ||
| // we need to break out of the loop so that callers can handle all the call requests. | ||
| // callers need to receive the call request. Unless executable function bypassing is enabled, | ||
| // return the complete batch without executing any invocable siblings. |
Summary
Updated
agent/harness/toolautocallso invocable local tool calls still run when the same assistant turn also includes declaration-only schema tools. The middleware now executes the invocable siblings, leaves declaration-only calls actionable for the caller, and marks only the executed local calls informational-only. Added a regression test covering mixed-call ordering.Ported .NET PRs
aaaa56bc60b6703b305664f196e74b284e425918, based ondotnet/src/Microsoft.Agents.AI/ChatClient/InvocableFunctionBypassingChatClient.csanddotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/InvocableFunctionBypassingChatClientTests.cs.Breaking Changes
No.
Tests and Examples
go test ./agent/harness/toolautocallTestFunctionInvoking_MixedInvocableAndNonInvocableSchemaToolExecutesInvocableSiblingNotes
agent/harness/toolautocall; no exported Go API changed.TerminateOnUnknownCallsbehavior for unknown tools and only realigned mixed invocable/declaration-only schema-tool handling.Closes #842