Skip to content

[Bug]: A2ACardResolver.get_agent_card makes bad URLs when agent_card_path empty #799

@mwri

Description

@mwri

What happened?

Calling A2ACardResolver(httpx_client, base_url, agent_card_path="").get_agent_card() yields a URL with a slash on the end, which may be benign, but sometimes is not, if it looks like https://host/some/path/.well-known/agent-card.json/ for example.

I came across this because I wanted to download the card from a card URL, not actually having a base and postfix path. It seems ridiculous to split my URL just so get_agent_card() can put it back together, but looking at the A2ACardResolver implementation it seems impossible to do it any other way.

I feel like the technically most undesirable behaviour seems to be that for a technically valid if surprising A2ACardResolver(agent_card_path=""), the call to get_agent_card() will always yield a trailing slash. For some paths that is innocuous, but others it is not.

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

component: clientIssues related to transport logic and configuration for external apps connecting to A2A agents.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions