Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(a2a): assert the property agent returns listings, not just non-empty text (#34515)

devin-ai-integration[bot]6a180e9e5d26
diff --git a/tests/e2e/a2a/a2a_client.py b/tests/e2e/a2a/a2a_client.py
index 3835ef64220..916ef623d3a 100644
--- a/tests/e2e/a2a/a2a_client.py
+++ b/tests/e2e/a2a/a2a_client.py
@@ -191,11 +191,52 @@ class A2ATaskStatus(BaseModel):
message: A2AResponseMessage | None = None
+class A2AListingLocation(BaseModel):
+ """Only the location fields a test reads back off a returned listing."""
+
+ un_locode: str | None = None
+
+
+class A2AListing(BaseModel):
+ """A single property card from the agent's `search_results` artifact; only the
+ identity/location fields a test asserts on are modelled."""
+
+ raia_id: str
+ property_type: str | None = None
+ service_type: str | None = None
+ location: A2AListingLocation = A2AListingLocation()
+
+
+class A2ASearchResults(BaseModel):
+ """The DataPart payload the property agent's `search_properties` skill returns:
+ the run count plus the listing cards themselves. Proof the tool actually ran and
+ matched, not just that the task completed with some text."""
+
+ total: int
+ count: int
+ listings: list[A2AListing] = []
+
+
+class A2AArtifactPart(BaseModel):
+ kind: str | None = None
+ data: A2ASearchResults | None = None
+
+
+class A2AArtifact(BaseModel):
+ model_config = ConfigDict(populate_by_name=True)
+
+ artifact_id: str | None = Field(default=None, alias="artifactId")
+ name: str | None = None
+ parts: list[A2AArtifactPart] = []
+
+
class A2AResult(BaseModel):
"""A message/send result. In 0.3 the message fields sit directly on the result
(`kind`/`role`/`parts`); in 1.0 they are nested under `message`; a real agent that
- runs a task replies with a `task` whose agent text lives on `status.message`.
- `text` reads the agent's reply from whichever shape the served version produced."""
+ runs a task replies with a `task` whose agent text lives on `status.message` and
+ whose tool output lives on `artifacts`. `text` reads the agent's reply from
+ whichever shape the served version produced; `search_results` reads the tool's
+ structured output when the agent ran a skill."""
model_config = ConfigDict(populate_by_name=True)
@@ -205,6 +246,7 @@ class A2AResult(BaseModel):
parts: list[A2AResponsePart] = []
message: A2AResponseMessage | None = None
status: A2ATaskStatus | None = None
+ artifacts: list[A2AArtifact] = []
@property
def text(self) -> str:
@@ -222,6 +264,14 @@ class A2AResult(BaseModel):
def is_nested_v1_shape(self) -> bool:
return self.message is not None
+ @property
+ def search_results(self) -> A2ASearchResults | None:
+ for artifact in self.artifacts:
+ for part in artifact.parts:
+ if part.data is not None:
+ return part.data
+ return None
+
class A2AError(BaseModel):
code: int
diff --git a/tests/e2e/a2a/test_a2a_agent_e2e.py b/tests/e2e/a2a/test_a2a_agent_e2e.py
index 4b05dbeb3ed..802b01455b1 100644
--- a/tests/e2e/a2a/test_a2a_agent_e2e.py
+++ b/tests/e2e/a2a/test_a2a_agent_e2e.py
@@ -117,6 +117,7 @@ class TestA2AAgentLifecycle:
agent = unwrap(client.register_agent(body))
resources.defer(lambda: client.delete_agent(agent.agent_id))
assert agent.agent_card_params.protocol_version == "0.3"
+ location = "GBLON"
request = A2AJsonRpcRequest(
id=f"e2e-{unique_marker()}",
params=A2AMessageSendParams(
@@ -125,7 +126,7 @@ class TestA2AAgentLifecycle:
A2ADataPart(
data=A2ASkillInvocation(
skill="search_properties",
- params=A2ASearchPropertiesParams(un_locode="USSFO", service_type="sale", asking_price_max=2_000_000, limit=3),
+ params=A2ASearchPropertiesParams(un_locode=location, service_type="long_term", limit=3),
)
)
],
@@ -136,7 +137,12 @@ class TestA2AAgentLifecycle:
response = unwrap(client.send_message(agent.agent_id, scoped_key, request))
assert response.error is None
assert response.result is not None
- assert response.result.text.strip() != ""
+ results = response.result.search_results
+ assert results is not None, "agent returned no search_results artifact; skill did not run"
+ assert results.total > 0
+ assert results.listings, "search_properties matched nothing; agent returned no property cards"
+ assert all(listing.raia_id for listing in results.listings)
+ assert all(listing.location.un_locode == location for listing in results.listings)
@pytest.mark.covers("other.a2a.discovery.proxy_fronted_card")
def test_discovery_card_is_proxy_fronted(self, client: A2AClient, resources: ResourceManager, scoped_key: str) -> None: