From 0d483a7df920addb331dbc1dcda0b922afea044b Mon Sep 17 00:00:00 2001 From: mubashir1osmani Date: Fri, 24 Jul 2026 10:50:26 -0700 Subject: [PATCH] test(e2e): pin the a2a bridge agent's Anthropic key so message/send works (#34512) The a2a completion-bridge tests registered the agent with only custom_llm_provider and model, so the bridge's litellm.acompletion had no api_key and relied on the gateway resolving ANTHROPIC_API_KEY from its ambient env. When that env var is absent, POST /a2a/{id} returns 500 with "Missing Anthropic API Key" and every message/send test (completion bridge, pinned v0.3/v1.0 message shapes, semver serves) fails while the register/discovery/rejection tests still pass. Give A2ABridgeParams an optional api_key and register the bridge agent with api_key="os.environ/ANTHROPIC_API_KEY", matching how the rest of the suite wires anthropic-backed models (e.g. the ratelimit redis tests). The agent now carries its provider key explicitly instead of depending on ambient gateway env. --- tests/e2e/a2a/a2a_client.py | 1 + tests/e2e/a2a/test_a2a_agent_e2e.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/e2e/a2a/a2a_client.py b/tests/e2e/a2a/a2a_client.py index 97ffa8c34a3..3835ef64220 100644 --- a/tests/e2e/a2a/a2a_client.py +++ b/tests/e2e/a2a/a2a_client.py @@ -85,6 +85,7 @@ class A2ABridgeParams(BaseModel): custom_llm_provider: str model: str + api_key: str | None = None class AgentRegisterBody(BaseModel): diff --git a/tests/e2e/a2a/test_a2a_agent_e2e.py b/tests/e2e/a2a/test_a2a_agent_e2e.py index aa60b57f99b..4b05dbeb3ed 100644 --- a/tests/e2e/a2a/test_a2a_agent_e2e.py +++ b/tests/e2e/a2a/test_a2a_agent_e2e.py @@ -32,7 +32,11 @@ from e2e_config import unique_marker from e2e_http import Result, UnknownApiError, unwrap from lifecycle import ResourceManager -BRIDGE = A2ABridgeParams(custom_llm_provider="anthropic", model="claude-haiku-4-5") +BRIDGE = A2ABridgeParams( + custom_llm_provider="anthropic", + model="claude-haiku-4-5", + api_key="os.environ/ANTHROPIC_API_KEY", +) MOVEHOME_AGENT_CARD_URL = "https://movehome.org/.well-known/agent.json" MOVEHOME_ORIGIN = "https://movehome.org"