-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET: Fixes AgentWithHostedMCP chat fails: ErrorHTTP 404 (: 404) Resource not found #3856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
.NET: Fixes AgentWithHostedMCP chat fails: ErrorHTTP 404 (: 404) Resource not found #3856
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
| .AsIChatClient() | ||
| .CreateAIAgent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
Motivation and Context
AgentWithHostedMCPchat fails:ErrorHTTP 404 (: 404) Resource not found#3195