Skip to content

Sample agent_to_agent code does not work #47419

@buzahid

Description

@buzahid
  • Package Name: azure-ai-projects
  • Package Version: 2.2.0
  • Operating System: Windows
  • Python Version: 3.12

Describe the bug
The agent_to_agent.py code sample results in the following error:
openai.APIError: Agent card path must target the same host, project, and agent as the server URL.

To Reproduce
The same error occurs whether you create the A2A agent and connections in the Foundry Portal or using Powershell scripts:

  1. In an existing Foundry project, create an A2A agent either in the Foundry Portal or by configuring it using the doc instructions
  2. Create an A2A Tool either in the Foundry Portal or by using the powershell script referenced in the docs.
  3. Connect to the project, attach the A2APreviewTool to an agent and run a prompt

Expected behavior
The agent should be able to invoke the A2A tool. Instead, the error occurs:
openai.APIError: Agent card path must target the same host, project, and agent as the server URL.

Metadata

Metadata

Assignees

Labels

AI ProjectsService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions