.NET: Fixes AgentWithHostedMCP chat fails: ErrorHTTP 404 (: 404) Resource not found#3856
Open
rogerbarreto wants to merge 2 commits intomicrosoft:mainfrom
Open
.NET: Fixes AgentWithHostedMCP chat fails: ErrorHTTP 404 (: 404) Resource not found#3856rogerbarreto wants to merge 2 commits intomicrosoft:mainfrom
rogerbarreto wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the AgentWithHostedMCP .NET sample to align with newer Azure AI Agent Server / Azure OpenAI packages and the current Microsoft.Extensions.AI.OpenAI integration approach, addressing the reported hosted MCP chat failure.
Changes:
- Bumps
Azure.AI.AgentServer.AgentFrameworkandAzure.AI.OpenAIpackage versions. - Moves the sample to
Microsoft.Extensions.AI.OpenAI10.3.0and adjusts the agent creation pipeline to convert the Responses client into anIChatClient. - Improves the sample HTTP request file formatting by adding the standard blank line between headers and JSON bodies.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| dotnet/samples/HostedAgents/AgentWithHostedMCP/run-requests.http | Adds blank lines between headers and bodies to ensure HTTP client tooling parses requests correctly. |
| dotnet/samples/HostedAgents/AgentWithHostedMCP/Program.cs | Updates the Responses client flow to AsIChatClient() before creating the agent; removes an unused/now-unneeded using. |
| dotnet/samples/HostedAgents/AgentWithHostedMCP/AgentWithHostedMCP.csproj | Updates package versions and removes now-unneeded OpenAI-specific Agent Framework package reference in favor of Microsoft.Extensions.AI.OpenAI 10.3.0. |
SergeyMenshykh
approved these changes
Feb 12, 2026
peibekwe
approved these changes
Feb 12, 2026
westey-m
reviewed
Feb 12, 2026
Comment on lines
+28
to
29
| .AsIChatClient() | ||
| .CreateAIAgent( |
Contributor
There was a problem hiding this comment.
Is this sample using some really old packages? We don't have a sync CreateAIAgent anymore after all, especially not on IChatClient. It should now all be AsAIAgent right? Also, why would we not use the extension method on the responses client directly. It should be equivalent to the one on IChatClient, right?
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
AgentWithHostedMCPchat fails:ErrorHTTP 404 (: 404) Resource not found#3195