fix(a2a): align agent list annotation and test with the tuple return type

PR #36020 changed AgentRegistry.get_agent_list to return tuple[AgentResponse, ...], and PR #35163 added a test asserting the result equals []. Both were green on their own branches and only collided once they were both on litellm_internal_staging, so proxy-server has been failing on every PR since with 'assert () == []'.

Nothing user-facing was wrong: get_agents only iterates the result and rebuilds it with comprehensions, and FastAPI serializes a tuple to the same JSON array. The test expectation was simply stale, so it now compares against ().

The get_agents local was still annotated list[AgentResponse] while two branches assign the registry tuple straight into it, so it widens to Sequence[AgentResponse]. That covers both the tuple and the list branches without pretending the value is mutable.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mateo 2026-08-07 19:56:29 +00:00 • committed by Mateo Wang
parent 1a54e47639
commit 860e37597f
2 changed files with 2 additions and 2 deletions

View file

@ -253,7 +253,7 @@ async def get_agents(
)
try:
returned_agents: list[AgentResponse] = []
returned_agents: Sequence[AgentResponse] = ()
# Admin users get all agents
if (

View file

@ -2638,4 +2638,4 @@ async def test_ProxyConfig__init_non_llm_configs_empty_agents_key_clears_remembe
assert clean_agent_registry.config_agents == ()
clean_agent_registry.load_agents_from_db_and_config(db_agents=None)
assert clean_agent_registry.get_agent_list() == []
assert clean_agent_registry.get_agent_list() == ()