.NET: Opt in to client function forwarding for Responses hosting - #7844
Merged
Roger Barreto (rogerbarreto) merged 8 commits intoSep 9, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hosted agents ignoring tools in Responses API
.NET: Forward opted-in Responses API function tools
Aug 24, 2026
Member
|
Closing this, not ready as a draft, just for analysis. |
Roger Barreto (rogerbarreto)
temporarily deployed
to
github-app-auth
August 28, 2026 14:52 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
August 28, 2026 14:52 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
August 28, 2026 14:52 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
github-app-auth
August 28, 2026 14:53 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
marked this pull request as ready for review
August 28, 2026 14:53
Roger Barreto (rogerbarreto)
requested review from
SergeyMenshykh,
chetantoshniwal,
Peter Ibekwe (peibekwe) and
westey (westey-m)
as code owners
August 28, 2026 14:53
Roger Barreto (rogerbarreto)
temporarily deployed
to
github-app-auth
August 28, 2026 14:53 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
github-app-auth
September 9, 2026 14:47 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
September 9, 2026 14:47 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
September 9, 2026 14:47 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
github-app-auth
September 9, 2026 14:48 — with
GitHub Actions
Inactive
westey (westey-m)
approved these changes
Sep 9, 2026
This was referenced Sep 11, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Hosted agents exposed over the OpenAI Responses protocol reject client-provided tools by default. Applications sometimes need to supply function declarations through the conventional
toolsrequest field so the model can request functions executed by the calling application.This proposal adds an explicit experimental opt-in without promising conflict resolution in the hosting layer. Client function names, descriptions, and schemas can steer the model away from hosted functions and cause arguments or data to be returned to the caller.
Description & Review Guide
OpenAIResponsesMapOptions.DangerouslyAllowClientFunctionToolsis an experimental boolean, defaulting tofalse. When enabled without a custom factory, it selects a built-in mapping that converts function declarations intoChatClientAgentRunOptions.ChatOptions.Tools, preserving name, description, parameter schema, and optionalstrict.RunOptionsFactoryis the single mapping entry point. A custom factory receives the complete request settings, including rawTools, replaces the built-in mapping, and returns options that the hosting layer does not modify. The boolean has no effect on a custom factory. The existingOpenAIResponses.ToAgentRunRequest(body, mapOptions)helper uses the same factory; no agent-aware overload is needed.The previous conflict behavior types, name checks, deduplication, conflict decorator, and parallel-call override have been removed. The internal converter returns a named tuple
(ClientTools, RemainingTools)and does not assign a support policy to entries it leaves unconverted.Default endpoints still reject client tools. The opt-in enables only function declarations; it does not enable request
tool_choiceor other unsupported request settings. Non-function tools remain rejected by the built-in mapping.Duplicate names are forwarded without resolving collisions. The downstream ChatClient and provider determine whether duplicates are accepted and which function is selected. The hosting layer does not guarantee hosted-function precedence and does not change the developer's parallel-call configuration.
The mapping produces
ChatClientAgentRunOptions, not a provider-neutral tool contract. Other agent implementations may ignore those options; the hosting layer does not reject agents by type or add function support to them. Developers can supply a custom factory for their agent's contract.The existing
MapOpenAIResponseslimitation on subsequentfunction_call_outputinput items is not addressed here. This proposal covers declaration forwarding and returned function calls, not the complete client function result continuation flow.The explicit boolean opt-in and risk documentation; the single mapping contract and custom-factory precedence; declaration fidelity; and leaving collision handling, execution, and parallelism to downstream components. Coverage includes default rejection, raw request preservation, duplicate forwarding, custom factories, hosted functions and MCP tools, non-chat agents, and a credential-gated live OpenAI scenario.
Related Issue
Related to #6416. This proposal addresses opt-in declaration forwarding, but does not implement request
tool_choiceor client function result continuation, so it does not automatically close the full issue.Contribution Checklist