diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting.A2A/AIAgentExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Hosting.A2A/AIAgentExtensions.cs index 499d724b1a..a2cb300687 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting.A2A/AIAgentExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Hosting.A2A/AIAgentExtensions.cs @@ -90,13 +90,7 @@ public static ITaskManager MapA2A( // we can help user if they did not set Url explicitly. if (string.IsNullOrEmpty(agentCard.Url)) { - var agentCardUrl = context.TrimEnd('/'); - if (!context.EndsWith("/v1/card", StringComparison.Ordinal)) - { - agentCardUrl += "/v1/card"; - } - - agentCard.Url = agentCardUrl; + agentCard.Url = context.TrimEnd('/'); } return Task.FromResult(agentCard); diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/A2AIntegrationTests.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/A2AIntegrationTests.cs index 48cb19789a..f8604c7eac 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/A2AIntegrationTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/A2AIntegrationTests.cs @@ -77,7 +77,9 @@ public async Task MapA2A_WithAgentCard_CardEndpointReturnsCardWithUrlAsync() Assert.NotNull(url); Assert.NotEmpty(url); Assert.StartsWith("http", url, StringComparison.OrdinalIgnoreCase); - Assert.Equal($"{testServer.BaseAddress.ToString().TrimEnd('/')}/a2a/test-agent/v1/card", url); + + // agentCard's URL matches the agent endpoint + Assert.Equal($"{testServer.BaseAddress.ToString().TrimEnd('/')}/a2a/test-agent", url); } finally {