Skip to content

.NET: [Bug]: Foundry Toolbox tools are silently dropped when a workflow is hosted as the top-level agent #10412

Open

Description

Observed Behavior

When a WorkflowHostAgent (a workflow exposed with AsAIAgent()) is registered as the hosted agent behind MapFoundryResponses(), the Foundry Toolbox tools never reach any executor, and nothing reports it.

AgentFrameworkResponseHandler resolves the toolbox tools per request and appends them to ChatOptions.Tools, then calls the agent with new ChatClientAgentRunOptions(chatOptions) (dotnet/src/Microsoft.Agents.AI.Foundry.Hosting/AgentFrameworkResponseHandler.cs, the block that does chatOptions.Tools = [.. chatOptions.Tools ?? [], .. toolboxResolution.Tools]).

WorkflowHostAgent.RunCoreAsync / RunCoreStreamingAsync accept AgentRunOptions? options but never read it (dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostAgent.cs; searching the file for ChatOptions, Tools or options usage finds only the parameter declarations). The toolbox tools are therefore dropped before the workflow starts.

Result: a workflow hosted as the top-level agent runs with no toolbox tools, even though AddFoundryToolboxes / TOOLBOX_NAME is configured and the toolbox resolved successfully. The agent answers as if the tools did not exist, with no error or warning.

Expected Behavior

One of these, documented:

  • the handler or WorkflowHostAgent makes the per-request resolved tools available to the workflow (for example through a run-scoped service or the workflow context that executors can read), or
  • the host fails fast or logs a warning when toolbox tools were resolved for a request but the target agent cannot accept them.

Workaround in use

A thin DelegatingAIAgent wraps a normal ChatClientAgent. It receives the ChatClientAgentRunOptions, builds a workflow per request and hands the tools to the executors through a closure. This works, but every consumer has to rediscover that the tools are silently lost.

Reproduction

  1. Host workflow.AsAIAgent() through AddFoundryResponses() + MapFoundryResponses() with TOOLBOX_NAME set to a toolbox that exposes at least one MCP tool.
  2. Make an executor (or an agent inside the workflow) list or call the available tools.
  3. Observe that no toolbox tool is available, while a plain ChatClientAgent registered the same way sees them.

Package Versions

Microsoft.Agents.AI.Foundry.Hosting 1.28.0-preview.261106.1, Microsoft.Agents.AI.Workflows 1.28.0, Microsoft.Agents.AI.Abstractions 1.28.0

.NET Version

.NET 10

Activity

  1. added
    .NET
    triage
    on Nov 17, 2026
  2. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor

    Routing result: inconclusive, not run. I did not execute a runtime reproduction (no live Foundry toolbox is available here). Source review of commit 82c49ab supports the report:

    • AgentFrameworkResponseHandler.cs appends resolved toolbox tools to chatOptions.Tools (~line 338) and passes new ChatClientAgentRunOptions(chatOptions) (~line 350).
    • WorkflowHostAgent.cs declares AgentRunOptions? options in RunCoreAsync/RunCoreStreamingAsync (lines 155, 181) and has no other options usage, so the tools are not forwarded to the workflow.

    Support boundary: unclear. I found no maintained spec or docs promising per-request toolbox tools for workflows hosted as the top-level agent, so a maintainer needs to decide whether this is a bug or a scope or feature question. The cause is in this repository; ownership is split between Foundry.Hosting and Workflows. I routed to Foundry.Hosting, but Workflows may need to be involved.

    Run: https://github.com/microsoft/agent-framework/actions/runs/44196395171

    Generated by Issue Routing for #10412 · copilot · auto · ~18 AIC · ⌖ ~1 AIC · ⊞ 5.2K · ◷

  3. added
    foundry
    hosting
    needs-maintainer-triage
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETfoundryhostingneeds-maintainer-triagetriage

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions