Skip to content

[dotnet-port-fixes] Execute invocable tool siblings #842

Description

@github-actions

Summary

Updated agent/harness/toolautocall so 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

Breaking Changes

No.

Tests and Examples

  • go test ./agent/harness/toolautocall
  • Added TestFunctionInvoking_MixedInvocableAndNonInvocableSchemaToolExecutesInvocableSibling
  • No examples changed

Notes

  • Kept the fix internal to agent/harness/toolautocall; no exported Go API changed.
  • Preserved existing TerminateOnUnknownCalls behavior for unknown tools and only realigned mixed invocable/declaration-only schema-tool handling.

Generated by .NET to Go Fixes and Test Porting Agent · gpt54 · 212.2 AIC · ⌖ 12.4 AIC · ⊞ 24.2K ·


Note

This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch copilot/dotnet-port-fixes-toolautocall-mixed-calls-d7ea5478fe3d9fd5.

Click here to create the pull request

To fix the permissions issue, go to SettingsActionsGeneral and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ

Show patch preview (182 of 182 lines)
From a26c3605f50f7db7c237a0f39de58c066cae389e Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Fri, 14 Aug 2026 03:23:30 +0000
Subject: [PATCH] [dotnet-port-fixes] Execute invocable tool siblings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 agent/harness/toolautocall/autocall.go      | 42 ++++++++++++++++-----
 agent/harness/toolautocall/autocall_test.go | 39 +++++++++++++++++++
 2 files changed, 71 insertions(+), 10 deletions(-)

diff --git a/agent/harness/toolautocall/autocall.go b/agent/harness/toolautocall/autocall.go
index 5be95edbc..03f198756 100644
--- a/agent/harness/toolautocall/autocall.go
+++ b/agent/harness/toolautocall/autocall.go
@@ -117,6 +117,11 @@ type autocall struct {
 	enableMessageInjection             bool
 }
 
+type functionCallExecutionPlan struct {
+	process   []*message.FunctionCallContent
+	terminate bool
+}
+
 // New creates a new function-invoking chat client that wraps the provided client.
 func New(cfg Config) agent.Middleware {
 	if cfg.NewID == nil {
@@ -292,9 +297,11 @@ func (f *autocall) Run(next agent.RunFunc, ctx context.Context, messages []*mess
 					return
 				}
 			}
+			executionPlan := f.buildFunctionCallExecutionPlan(ctx, functionCallContents, tools)
+
 			// If there's nothing more to do, break out of the loop and allow the handling at the
 			// end to configure the response with aggregated data from previous requests.
-			if i >= f.maximumIterationsPerRequest || hasApprovalRequiringFcc || f.shouldTerminateLoopBasedOnHandleableFunctions(ctx, functionCallContents, tools) {
+			if i >= f.maximumIterationsPerRequest || hasApprovalRequiringFcc || (executionPlan.terminate && len(executionPlan.process) == 0) {
 				// When message injection is enabled, check if any tools enqueued messages
 				// during this iteration.  If so, add them to the conversation and continue
 				// the loop so the provider sees the new user messages — even though
... (truncated)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions