Skip to content

Fix Agent Framework sample#132

Merged
abdulanu0 merged 3 commits intomainfrom
users/anabdul/agentframework_issue
Dec 18, 2025
Merged

Fix Agent Framework sample#132
abdulanu0 merged 3 commits intomainfrom
users/anabdul/agentframework_issue

Conversation

@abdulanu0
Copy link
Contributor

No description provided.

@abdulanu0 abdulanu0 requested a review from a team as a code owner December 15, 2025 00:29
Copilot AI review requested due to automatic review settings December 15, 2025 00:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UseAgenticAuth configuration 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)

- 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
@abdulanu0 abdulanu0 merged commit a323aa9 into main Dec 18, 2025
7 checks passed
@abdulanu0 abdulanu0 deleted the users/anabdul/agentframework_issue branch December 18, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants