-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Labels
Description
After upgrading to the latest SDK, calling app.MapA2A(RatingAgent.Name, $"/a2a/{RatingAgent.Name}", RatingAgent.AgentCard); causes a runtime failure due to an uninitialized URI in the AgentCard.
Stack trace (simplified):
System.UriFormatException: Invalid URI: The URI is empty.
at System.Uri..ctor(String uriString)
at A2A.A2AAgentCardExtensions.GetAIAgentAsync(AgentCard card, HttpClient httpClient, ILoggerFactory loggerFactory)
at BookWorm.Chassis.AI.Agents.A2AClientFactory.CreateA2AAgentClient(String serviceName, String agentName, String path)
...
Expected behavior
The AgentCard should have its URI assigned automatically when using the one-liner app.MapA2A(...), consistent with the previous SDK behavior.
Actual behavior
AgentCard is missing its Uri property, leading to System.UriFormatException when the SDK attempts to resolve or initialize the agent client.
✅ Previously working code
var ratingAgent = app.Services.GetRequiredKeyedService<AIAgent>(RatingAgent.Name);
app.MapA2A(
new A2AHostAgent(ratingAgent, RatingAgent.AgentCard).TaskManager!,
$"/a2a/{RatingAgent.Name}"
);This code successfully assigns the URI on the AgentCard and runs as expected.
❌ Current failing code
app.MapA2A(
RatingAgent.Name,
$"/a2a/{RatingAgent.Name}",
RatingAgent.AgentCard
);You can refer this PR: foxminchan/BookWorm#210
📸 Screenshot
Reference:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done