point URL to agent, not to agentcard (#3176)

This commit is contained in:
Korolev Dmitry
2026-01-13 17:32:05 +01:00
committed by GitHub
Unverified
parent 9c094573e8
commit 5faa2851bb
2 changed files with 4 additions and 8 deletions
@@ -90,13 +90,7 @@ public static class AIAgentExtensions
// 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);
@@ -77,7 +77,9 @@ public sealed class A2AIntegrationTests
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
{