Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes the Agent Framework sample by improving local testing support and error handling. It introduces a UseAgenticAuth configuration flag that allows developers to disable agentic authentication for local testing scenarios, preventing MCP tool failures when authentication infrastructure is not available.
Key Changes
- Added
UseAgenticAuthconfiguration option to enable/disable agentic authentication for MCP tools - Simplified authentication handler registration by removing the unused "me" auth handler
- Added try-catch error handling around MCP tool registration to gracefully fall back to local tools only
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| dotnet/agent-framework/sample-agent/appsettings.json | Adds UseAgenticAuth configuration flag with inline comment explaining its purpose for local testing |
| dotnet/agent-framework/sample-agent/Agent/MyAgent.cs | Removes unused "MyAuthHandler", adds UseAgenticAuth check before MCP tool registration, wraps MCP tool loading in try-catch with fallback logging |
Comments suppressed due to low confidence (1)
dotnet/agent-framework/sample-agent/Agent/MyAgent.cs:223
- Condition is always false because of ... != ....
else if (toolService != null && !useAgenticAuth)
pontemonti
reviewed
Dec 15, 2025
pontemonti
reviewed
Dec 15, 2025
pontemonti
reviewed
Dec 15, 2025
pontemonti
reviewed
Dec 15, 2025
- Add MsalUserAuthorization configuration for 'me' handler in appsettings.json - Change MCP tool registration error handling to throw instead of swallow - Remove UseAgenticAuth skip logic - use mock MCP servers for local testing
pontemonti
approved these changes
Dec 15, 2025
tmlsousa
approved these changes
Dec 18, 2025
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.
No description provided.