.NET: Improve AIAgent and Workflow registrations for DevUI integration#2227
Merged
DeagleGross merged 21 commits intomainfrom Nov 18, 2025
Merged
.NET: Improve AIAgent and Workflow registrations for DevUI integration#2227DeagleGross merged 21 commits intomainfrom
AIAgent and Workflow registrations for DevUI integration#2227DeagleGross merged 21 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the agent and workflow registration API by removing the AgentCatalog and WorkflowCatalog abstractions in favor of direct keyed service resolution. It introduces a new AddDevUI() extension method that enables DevUI integration by automatically converting registered workflows to agents when needed.
Key Changes:
- Removed
AgentCatalogandWorkflowCatalogpublic APIs and their internal registry implementations - Added
AddDevUI()extension methods forIServiceCollectionandIHostApplicationBuilder - Updated entity discovery to enumerate keyed services directly using
KeyedService.AnyKey
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.DevUI/ServiceCollectionsExtensions.cs | New extension method to register DevUI services with keyed service factory for workflow-to-agent conversion |
| dotnet/src/Microsoft.Agents.AI.DevUI/HostApplicationBuilderExtensions.cs | New extension method to add DevUI services to IHostApplicationBuilder |
| dotnet/src/Microsoft.Agents.AI.DevUI/EntitiesApiExtensions.cs | Updated entity discovery to use direct keyed service enumeration instead of catalog pattern |
| dotnet/src/Microsoft.Agents.AI.DevUI/README.md | Updated documentation to show new AddDevUI() registration |
| dotnet/src/Microsoft.Agents.AI.Hosting/HostApplicationBuilderWorkflowExtensions.cs | Removed workflow registry registration logic |
| dotnet/src/Microsoft.Agents.AI.Hosting/AgentHostingServiceCollectionExtensions.cs | Removed agent registry registration logic |
| dotnet/src/Microsoft.Agents.AI.Hosting/Local/LocalAgentCatalog.cs | Removed internal catalog implementation |
| dotnet/src/Microsoft.Agents.AI.Hosting/Local/LocalAgentRegistry.cs | Removed internal registry |
| dotnet/src/Microsoft.Agents.AI.Hosting/Local/LocalWorkflowCatalog.cs | Removed internal catalog implementation |
| dotnet/src/Microsoft.Agents.AI.Hosting/Local/LocalWorkflowRegistry.cs | Removed internal registry |
| dotnet/src/Microsoft.Agents.AI.Hosting/AgentCatalog.cs | Removed public catalog abstraction |
| dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/HostedAgentResponseExecutor.cs | Improved error message for agent not found scenarios |
| dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Program.cs | Added DevUI registration and additional test agent/workflow registrations |
| dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/ActorFrameworkWebApplicationExtensions.cs | Updated agent discovery to use keyed services directly |
| dotnet/samples/AgentWebChat/AgentWebChat.AppHost/Program.cs | Added DevUI endpoint configuration |
| dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/Properties/launchSettings.json | Added launch settings for the test project |
dotnet/src/Microsoft.Agents.AI.DevUI/ServiceCollectionsExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/Properties/launchSettings.json
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/HostedAgentResponseExecutor.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/HostedAgentResponseExecutor.cs
Show resolved
Hide resolved
dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/ActorFrameworkWebApplicationExtensions.cs
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.DevUI/ServiceCollectionsExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.DevUI/ServiceCollectionsExtensions.cs
Outdated
Show resolved
Hide resolved
Member
BrennanConroy
left a comment
There was a problem hiding this comment.
Non-keyed agents/workflows aren't handled
dotnet/src/Microsoft.Agents.AI.DevUI/HostApplicationBuilderExtensions.cs
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.DevUI/ServiceCollectionsExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.DevUI.UnitTests/DevUIExtensionsTests.cs
Outdated
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.DevUI.UnitTests/Microsoft.Agents.AI.DevUI.UnitTests.csproj
Outdated
Show resolved
Hide resolved
BrennanConroy
approved these changes
Nov 17, 2025
javiercn
reviewed
Nov 18, 2025
dotnet/tests/Microsoft.Agents.AI.DevUI.UnitTests/Properties/launchSettings.json
Show resolved
Hide resolved
javiercn
reviewed
Nov 18, 2025
dotnet/tests/Microsoft.Agents.AI.DevUI.UnitTests/DevUIExtensionsTests.cs
Outdated
Show resolved
Hide resolved
javiercn
reviewed
Nov 18, 2025
dotnet/tests/Microsoft.Agents.AI.DevUI.UnitTests/DevUIExtensionsTests.cs
Outdated
Show resolved
Hide resolved
javiercn
reviewed
Nov 18, 2025
dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/Properties/launchSettings.json
Show resolved
Hide resolved
javiercn
reviewed
Nov 18, 2025
javiercn
approved these changes
Nov 18, 2025
Contributor
javiercn
left a comment
There was a problem hiding this comment.
Looks good, but I would review the unit tests. I feel they are essentially testing DI behaviors.
javiercn
approved these changes
Nov 18, 2025
SergeyMenshykh
approved these changes
Nov 18, 2025
This was referenced Nov 18, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…ation (microsoft#2227) * wip * resolve non-agent workflows as well! * add tests for devui registrations and resolving * fixes * devui for net8 as well! * simplify TFM * update tfm... * tfm rules.... * wip * roll * verify entities are registered with a devui call * tests * add a proper support for non-keyed workflows * resolve default aiagent registration * sort usings :) * cleanup tests
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
Today there are a couple of disrepancies between registrations and DevUI behavior:
AIAgentis not registered viaAddAIAgent(), but added to the ASP.NET Core DI directly, then it will not be displayed in the DevUI at all.AIAgent(for example viaAddAsAIAgent()), then it will be visible in DevUI, but it will simply not work.Workflows andAIAgents registered as non-keyed services will not be visible at all.The reason is that DevUI <-> AF communication works via OpenAI Responses, and OpenAI Responses implementation resolves the request model through
AIAgentby the name from keyed services.The PR actually simplifies the public API (removed
AgentCatalogandWorkflowCatalog).Contribution Checklist
Fixes #2149
Related #2084