Repository navigation
.Net: [BREAKING] Remove retired OpenAI Assistants agent and port samples to Foundry Prompt Agents - #14826
Open
Roger Barreto (rogerbarreto) wants to merge 4 commits into
Open
.Net: [BREAKING] Remove retired OpenAI Assistants agent and port samples to Foundry Prompt Agents#14826Roger Barreto (rogerbarreto) wants to merge 4 commits into
Roger Barreto (rogerbarreto) wants to merge 4 commits into
Conversation
…dry Prompt Agents OpenAI shut down the Assistants API on August 26, 2026, so every OpenAIAssistantAgent call now fails. - Remove OpenAIAssistantAgent, OpenAIAssistantAgentThread, the declarative OpenAIAssistantAgentFactory (openai_assistant), the Assistants option and definition types, RunPollingOptions, OpenAIClientProvider, AssistantClientExtensions, OpenAIClientExtensions, ToThreadInitializationMessage(s), ToToolDefinition, the internal Assistants run and message helpers, and their unit tests. Agents.OpenAI keeps OpenAIResponseAgent. - Port every Assistants sample to a Microsoft Foundry Prompt Agent used through a ChatCompletionAgent (GettingStartedWithAgents/FoundryPromptAgent, Concepts FoundryPromptAgent_* and MixedChat_*, telemetry, orchestration, declarative and process samples). - Add FoundryPromptAgentExtensions and BaseFoundryAgentTest sample utilities. The kernel chat client wraps the Agent Framework Foundry chat client so that Semantic Kernel runs function calling and its filters. - Bump Microsoft.Extensions.AI.OpenAI to 10.5.2 to match Microsoft.Extensions.AI.Abstractions 10.5.2; 10.5.0 fails at runtime with MissingMethodException when converting Responses output.
…ractions 10.5.2 Bump Microsoft.Extensions.AI to 10.5.2 so the whole Microsoft.Extensions.AI package family shares one patch version. This matches the same change in microsoft#14823, so both pull requests merge cleanly in either order.
Roger Barreto (rogerbarreto)
temporarily deployed
to
github-app-auth
November 18, 2026 20:28 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
With launchViewer: true, automatically opening generated citations with their original extensions can execute .cmd or .bat files on a developer’s machine.
2 open issues
What changed in this PR
This PR removes the retired .NET OpenAI Assistants integration and migrates its samples to Microsoft Foundry Prompt Agents through ChatCompletionAgent. It retains OpenAIResponseAgent and leaves Python unchanged.
Changes:
- Removes Assistants-specific APIs, factories, helpers, and unit tests.
- Ports samples to Foundry, adding shared setup, tool integration, and resource cleanup.
- Updates documentation and dependencies, including the version alignment also proposed in #14823.
| File | Description |
|---|---|
dotnet/src/InternalUtilities/samples/InternalUtilities/TestConfiguration.cs |
Removes unused Assistant ID configuration. |
dotnet/src/InternalUtilities/samples/AgentUtilities/BaseOrchestrationTest.cs |
Adds Foundry agent creation and cleanup. |
dotnet/src/InternalUtilities/samples/AgentUtilities/BaseFoundryAgentTest.cs |
Adds shared Foundry sample utilities. |
dotnet/src/InternalUtilities/samples/AgentUtilities/BaseAzureAgentTest.cs |
Removes Assistants-specific output handling. |
dotnet/src/InternalUtilities/samples/AgentUtilities/BaseAssistantTest.cs |
Deletes the Assistants sample base. |
dotnet/src/InternalUtilities/samples/AgentUtilities/BaseAgentsTest.cs |
Uses Azure agent metadata and usage types. |
dotnet/src/InternalUtilities/process/Runtime/AgentFactoryFactory.cs |
Removes the Assistants factory mapping. |
dotnet/src/Agents/UnitTests/Yaml/AgentYamlTests.cs |
Removes Assistants YAML tests and setup. |
dotnet/src/Agents/UnitTests/OpenAI/RunPollingOptionsTests.cs |
Deletes retired polling-option tests. |
dotnet/src/Agents/UnitTests/OpenAI/OpenAIThreadCreationOptionsTests.cs |
Deletes retired thread-option tests. |
dotnet/src/Agents/UnitTests/OpenAI/OpenAIClientProviderTests.cs |
Deletes retired client-provider tests. |
dotnet/src/Agents/UnitTests/OpenAI/OpenAIAssistantInvocationOptionsTests.cs |
Deletes Assistants invocation-option tests. |
dotnet/src/Agents/UnitTests/OpenAI/OpenAIAssistantDefinitionTests.cs |
Deletes Assistants definition tests. |
dotnet/src/Agents/UnitTests/OpenAI/OpenAIAssistantAgentInvokeOptionsTests.cs |
Deletes Assistants invoke-option tests. |
dotnet/src/Agents/UnitTests/OpenAI/OpenAIAssistantAgentExtensionsTests.cs |
Deletes Assistants adapter tests. |
dotnet/src/Agents/UnitTests/OpenAI/Internal/AssistantRunOptionsFactoryTests.cs |
Deletes run-option factory tests. |
dotnet/src/Agents/UnitTests/OpenAI/Internal/AssistantMessageFactoryTests.cs |
Deletes Assistants message-conversion tests. |
dotnet/src/Agents/UnitTests/OpenAI/Extensions/OpenAIClientExtensionsTests.cs |
Deletes removed client-helper tests. |
dotnet/src/Agents/UnitTests/OpenAI/Extensions/KernelFunctionExtensionsTests.cs |
Deletes Assistants tool-conversion tests. |
dotnet/src/Agents/UnitTests/OpenAI/Extensions/KernelExtensionsTests.cs |
Deletes obsolete client-provider test scaffolding. |
dotnet/src/Agents/UnitTests/OpenAI/Extensions/AuthorRoleExtensionsTests.cs |
Deletes Assistants role-conversion tests. |
dotnet/src/Agents/UnitTests/OpenAI/Extensions/AgentDefinitionExtensionsTests.cs |
Deletes Assistants definition-helper tests. |
dotnet/src/Agents/UnitTests/OpenAI/Definition/OpenAIAssistantAgentFactoryTests.cs |
Deletes Assistants factory tests. |
dotnet/src/Agents/OpenAI/RunPollingOptions.cs |
Removes Assistants polling configuration. |
dotnet/src/Agents/OpenAI/OpenAIThreadCreationOptions.cs |
Removes legacy thread-creation options. |
dotnet/src/Agents/OpenAI/OpenAIClientProvider.cs |
Removes the legacy client provider. |
dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs |
Removes legacy invocation options. |
dotnet/src/Agents/OpenAI/OpenAIAssistantExecutionOptions.cs |
Removes legacy execution options. |
dotnet/src/Agents/OpenAI/OpenAIAssistantDefinition.cs |
Removes the Assistants definition model. |
dotnet/src/Agents/OpenAI/OpenAIAssistantChannel.cs |
Removes the Assistants chat channel. |
dotnet/src/Agents/OpenAI/OpenAIAssistantCapabilities.cs |
Removes the Assistants capability model. |
dotnet/src/Agents/OpenAI/OpenAIAssistantAgentThread.cs |
Removes Assistants thread management. |
dotnet/src/Agents/OpenAI/OpenAIAssistantAgentInvokeOptions.cs |
Removes Assistants invocation settings. |
dotnet/src/Agents/OpenAI/OpenAIAssistantAgentExtensions.cs |
Removes the Assistants Agent Framework adapter. |
dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.ClientFactory.cs |
Removes Assistants client factories. |
dotnet/src/Agents/OpenAI/Logging/OpenAIAssistantAgentLogMessages.cs |
Removes Assistants agent logging helpers. |
dotnet/src/Agents/OpenAI/Logging/AssistantThreadActionsLogMessages.cs |
Removes Assistants thread logging helpers. |
dotnet/src/Agents/OpenAI/Internal/AssistantToolResourcesFactory.cs |
Removes Assistants tool-resource construction. |
dotnet/src/Agents/OpenAI/Internal/AssistantRunOptionsFactory.cs |
Removes Assistants run-option construction. |
dotnet/src/Agents/OpenAI/Internal/AssistantMessageFactory.cs |
Removes Assistants message conversion. |
dotnet/src/Agents/OpenAI/Extensions/OpenAIClientExtensions.cs |
Removes file and vector-store convenience helpers. |
dotnet/src/Agents/OpenAI/Extensions/ModelConnectionExtensions.cs |
Removes Assistants connection helpers. |
dotnet/src/Agents/OpenAI/Extensions/KernelFunctionExtensions.cs |
Removes Assistants conversion; retains Responses support. |
dotnet/src/Agents/OpenAI/Extensions/ChatContentMessageExtensions.cs |
Removes Assistants thread-message conversion. |
dotnet/src/Agents/OpenAI/Extensions/AuthorRoleExtensions.cs |
Removes Assistants role conversion. |
dotnet/src/Agents/OpenAI/Extensions/AssistantClientExtensions.cs |
Removes Assistants creation helpers. |
dotnet/src/Agents/OpenAI/Extensions/AgentDefinitionExtensions.cs |
Removes Assistants declarative-definition helpers. |
dotnet/src/Agents/OpenAI/Definition/OpenAIAssistantAgentFactory.cs |
Removes the declarative Assistants factory. |
dotnet/src/Agents/OpenAI/Agents.OpenAI.csproj |
Describes the retained Responses integration. |
dotnet/src/Agents/Abstractions/Logging/AggregatorAgentLogMessages.cs |
Renames aggregator restore logging methods and messages. |
dotnet/src/Agents/Abstractions/AggregatorAgent.cs |
Calls the renamed aggregator logging methods. |
dotnet/src/Agents/Abstractions/Agent.cs |
Updates a documentation example to Azure AI agents. |
dotnet/samples/GettingStartedWithProcesses/Step04/Step04_AgentOrchestration.cs |
Uses Foundry for the single-agent process sample. |
dotnet/samples/GettingStartedWithProcesses/GettingStartedWithProcesses.csproj |
Adds Foundry dependencies and shared helper inclusion. |
dotnet/samples/GettingStartedWithAgents/Step10_MultiAgent_Declarative.cs |
Removes unused Assistants client and factory registration. |
dotnet/samples/GettingStartedWithAgents/Step07_Telemetry.cs |
Migrates telemetry demonstrations to Foundry. |
dotnet/samples/GettingStartedWithAgents/README.md |
Documents Foundry samples and configuration. |
dotnet/samples/GettingStartedWithAgents/Orchestration/Step06_DifferentAgentTypes.cs |
Replaces Assistants with Foundry-backed agents. |
dotnet/samples/GettingStartedWithAgents/OpenAIAssistant/Step06_AssistantTool_Function.cs |
Removes the Assistants function-tool sample. |
dotnet/samples/GettingStartedWithAgents/OpenAIAssistant/Step05_AssistantTool_FileSearch.cs |
Removes the Assistants file-search sample. |
dotnet/samples/GettingStartedWithAgents/OpenAIAssistant/Step04_AssistantTool_CodeInterpreter.cs |
Removes the Assistants code-interpreter sample. |
dotnet/samples/GettingStartedWithAgents/OpenAIAssistant/Step03_Assistant_Vision.cs |
Removes the Assistants vision sample. |
dotnet/samples/GettingStartedWithAgents/OpenAIAssistant/Step02_Assistant_Plugins.cs |
Removes the Assistants plugin sample. |
dotnet/samples/GettingStartedWithAgents/OpenAIAssistant/Step01_Assistant.cs |
Removes the Assistants templating sample. |
dotnet/samples/GettingStartedWithAgents/GettingStartedWithAgents.csproj |
Adds the Foundry integration dependency. |
dotnet/samples/GettingStartedWithAgents/FoundryPromptAgent/Step06_FoundryPromptAgentTool_Function.cs |
Demonstrates stored function tools and local plugins. |
dotnet/samples/GettingStartedWithAgents/FoundryPromptAgent/Step05_FoundryPromptAgentTool_FileSearch.cs |
Demonstrates Foundry file search. |
dotnet/samples/GettingStartedWithAgents/FoundryPromptAgent/Step04_FoundryPromptAgentTool_CodeInterpreter.cs |
Demonstrates Foundry code interpreter. |
dotnet/samples/GettingStartedWithAgents/FoundryPromptAgent/Step03_FoundryPromptAgent_Vision.cs |
Demonstrates image URLs and inline image input. |
dotnet/samples/GettingStartedWithAgents/FoundryPromptAgent/Step02_FoundryPromptAgent_Plugins.cs |
Demonstrates Foundry with local kernel plugins. |
dotnet/samples/GettingStartedWithAgents/FoundryPromptAgent/Step01_FoundryPromptAgent.cs |
Demonstrates Foundry with templated instructions. |
dotnet/samples/Concepts/README.md |
Links to the Foundry chart sample. |
dotnet/samples/Concepts/Concepts.csproj |
Adds the Foundry integration dependency. |
dotnet/samples/Concepts/Agents/README.md |
Updates sample guidance and Foundry configuration. |
dotnet/samples/Concepts/Agents/OpenAIAssistant_Streaming.cs |
Removes the Assistants streaming sample. |
dotnet/samples/Concepts/Agents/MixedChat_Streaming.cs |
Uses Foundry in streaming group chat. |
dotnet/samples/Concepts/Agents/MixedChat_Serialization.cs |
Uses Foundry in chat serialization demonstrations. |
dotnet/samples/Concepts/Agents/MixedChat_Reset.cs |
Uses Foundry in chat reset demonstrations. |
dotnet/samples/Concepts/Agents/MixedChat_Images.cs |
Uses Foundry for chart generation and downloads. |
dotnet/samples/Concepts/Agents/MixedChat_Files.cs |
Uses Foundry for file analysis and reports. |
dotnet/samples/Concepts/Agents/MixedChat_Agents.cs |
Combines Foundry and chat-completion services. |
dotnet/samples/Concepts/Agents/FoundryPromptAgent_Templating.cs |
Ports instruction-template demonstrations to Foundry. |
dotnet/samples/Concepts/Agents/FoundryPromptAgent_FileManipulation.cs |
Ports CSV manipulation to Foundry. |
dotnet/samples/Concepts/Agents/FoundryPromptAgent_ChartMaker.cs |
Ports chart generation to Foundry. |
dotnet/docs/EXPERIMENTS.md |
Removes the retired Assistants experiment entry. |
dotnet/Directory.Packages.props |
Aligns Microsoft.Extensions.AI packages at 10.5.2. |
.github/workflows/dotnet-build-and-test.yml |
Removes the obsolete Assistants test exclusion. |
Review effort: Balanced
- Open only generated images, through the shell's default viewer instead of a cmd.exe command line, because the model chooses generated file names. - Wait, with a timeout, for the file-search vector store to finish indexing before the first question, and delete every created resource on failure.
Roger Barreto (rogerbarreto)
temporarily deployed
to
github-app-auth
November 18, 2026 20:44 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
github-app-auth
November 20, 2026 22:25 — with
GitHub Actions
Inactive
This branch was previously deployed
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 and Context
OpenAI shut down the Assistants API on August 26, 2026 (OpenAI deprecations). Every
OpenAIAssistantAgentcall now fails, and the samples that teach it can no longer run.This PR removes the .NET Assistants agent surface and ports every Assistants sample to a Microsoft Foundry Prompt Agent, which is also the replacement that the migration guidance in #14823 recommends. A Foundry Prompt Agent is a versioned agent definition (model, instructions, and tools) stored in a Foundry project.
Python is not changed here. Porting the Python Assistants samples needs
azure-ai-projects2.x, which the current PythonAzureAIAgentcan't use yet, so that work is left for a follow-up.Description
Breaking: removed from
Microsoft.SemanticKernel.Agents.OpenAI(preview package)OpenAIAssistantAgent,OpenAIAssistantAgentThread,OpenAIAssistantAgentInvokeOptions, andOpenAIAssistantAgentExtensions.AsAIAgentOpenAIAssistantAgentFactoryand theopenai_assistantdeclarative agent typeOpenAIAssistantCapabilities,OpenAIAssistantDefinition,OpenAIAssistantExecutionOptions,OpenAIAssistantInvocationOptions,OpenAIThreadCreationOptions,RunPollingOptions, andOpenAIClientProviderAssistantClientExtensionsandOpenAIClientExtensions(vector store and file helpers that only the Assistants samples used)ChatContentMessageExtensions.ToThreadInitializationMessage(s)andKernelFunctionExtensions.ToToolDefinitionThe package keeps
OpenAIResponseAgent. SerializedOpenAIAssistantAgentThreadstate andopenai_assistantYAML definitions no longer load. Package validation is disabled for this preview package, so no compatibility suppressions were needed.Other library changes
ProcessAgentFactory(process framework) no longer maps theopenai_assistanttype.AggregatorAgentchannel restore log methods drop their leftoverOpenAIAssistantnames, and anAgent.csdoc example no longer mentions Assistants.Microsoft.Extensions.AIandMicrosoft.Extensions.AI.OpenAImove from 10.5.0 to 10.5.2 to matchMicrosoft.Extensions.AI.Abstractions10.5.2. With 10.5.0, every Responses conversion inMicrosoft.Extensions.AI.OpenAIthrowsMissingMethodExceptionforWebSearchToolResultContent.set_Results, because Abstractions 10.5.2 renamed that experimental member. .Net: Update Semantic Kernel to Agent Framework migration guidance and samples #14823 makes the identical change, so the two PRs merge cleanly in either order.How the samples use a Foundry Prompt Agent
The new sample helper
FoundryPromptAgentExtensions.AsKernelChatClientturns a Prompt Agent version into anIChatClientfor the kernel of aChatCompletionAgent:projectClient.AsAIAgent(agentVersion, clientFactory: ...)fromMicrosoft.Agents.AI.Foundrycaptures the innermost Agent Framework chat client. That client sends each request with the agent reference and drops the request options the service rejects when an agent is specified (model, instructions, and tools).DelegatingChatClientclears the conversation id that the Responses API returns, so theChatHistoryAgentThreadstays the only record of the conversation.UseKernelFunctionInvocation()lets Semantic Kernel run the function calling loop, soIFunctionInvocationFilterandIAutoFunctionInvocationFilterstill apply.Function schemas are declared on the Prompt Agent definition (
AddFunctionTools), and the plugin still runs locally. Files generated by the code interpreter are read from the container file citations in the raw response (ChatMessageContent.InnerContent).Step 2 works around a library bug that deserves its own fix:
KernelFunctionInvokingChatClientcallscontext.Messages.Last()(line 77), and Microsoft.Extensions.AI passes an empty message list once anIChatClientreturns a conversation id. This PR only works around it in sample code.Samples
GettingStartedWithAgents/OpenAIAssistant/Step01toStep07GettingStartedWithAgents/FoundryPromptAgent/Step01toStep07(templated instructions, plugins, vision, code interpreter, file search, stored function tools, declarative)Concepts/Agents/OpenAIAssistant_*Concepts/Agents/FoundryPromptAgent_*(chart maker, file manipulation, function filters, streaming, templating)Concepts/Agents/MixedChat_*ChatCompletionAgentStep07_Telemetry,Orchestration/Step06_DifferentAgentTypes,GettingStartedWithProcesses/Step04Step10_MultiAgent_DeclarativeBaseAssistantTestBaseFoundryAgentTest;BaseOrchestrationTestgetsCreateFoundryPromptAgentAsyncEvery sample deletes the Prompt Agents, files, and vector stores it creates. The vision sample uses images stored in this repository, because Wikimedia rate limits the Foundry image downloader. The READMEs and
EXPERIMENTS.mdare updated.Not changed:
AzureAIAgent(a different service), the obsoleteOpenAIFileServiceconnector, the ADRs, anddotnet/samples/AgentFrameworkMigration(#14823).Validation
dotnet build dotnet/SK-dotnet.slnx -c Debug --tl:off --warnaserror: 0 warnings, 0 errors.dotnet test -c Debug, net10.0): 5,471 passed, 0 failed, 22 skipped.dotnet format <project> --verify-no-changes(Windows, SDK 10.0.404) on the 9 projects with changed C# files: no changes. The CI container image could not restore locally because the network rejected its TLS connection to nuget.org, so CI provides the container check.GettingStartedWithAgentsFoundryPromptAgent(11 cases),ConceptsFoundryPromptAgent_*(14 cases) andMixedChat_*(12 cases),Orchestration/Step06_DifferentAgentTypessequential and group chat,Step07_Telemetrylogging and console tracing, and theGettingStartedWithProcessesStep04single agent process. The Application Insights tracing cases were not run because Application Insights is not configured.Contribution Checklist