litellm/tests/test_litellm/proxy/agent_endpoints
Yassin Kortam 4b9c289a72
fix(a2a): forward caller identity headers on message/send and message/stream (#40305)
* fix(a2a): forward caller identity headers on message/send and message/stream

_forwarding_headers() stamped X-LiteLLM-User-Id/-Team-Id from the authenticated
caller, but was only wired into the tasks/* and tasks/resubscribe branches. The
primary message/send and message/stream conversational path forwarded
agent_extra_headers unchanged, so a downstream agent never learned which end
user was calling it except on secondary task-management calls. This broke
per-user MCP scoping and per-customer FinOps budget enforcement for any agent
invoked through the normal conversational flow.

Resolves LIT-7342

* fix(a2a): snapshot key-bound caller identity before pre-call processing

user_header_mappings lets add_litellm_data_to_request rewrite
user_api_key_dict.user_id from a client header, so the identity stamped
onto X-LiteLLM-User-Id is now captured before that step runs. Header
tests updated to expect the caller identity on message/send.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(a2a): drop redundant docstrings from message identity tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(a2a): type the message method test helpers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(a2a): make message method test helpers immutable

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-08 15:56:52 -07:00
..
auth fix(agents): hide agents from non-admins who were never granted them (#39636) 2026-09-03 14:40:36 -07:00
__init__.py [Feat] Agent Gateway - Allow tracking request / response in "Logs" Page (#17449) 2025-12-03 18:57:18 -08:00
test_a2a_endpoints.py fix(a2a): forward caller identity headers on message/send and message/stream (#40305) 2026-09-08 15:56:52 -07:00
test_a2a_version_e2e.py fix(a2a): return SSE (text/event-stream) for message/stream instead of NDJSON (#35037) 2026-08-20 16:19:58 -07:00
test_agent_header_isolation.py test(a2a): stub card resolver in create_a2a_client unit tests 2026-08-22 04:17:16 +00:00
test_agent_headers.py fix(a2a): forward caller identity headers on message/send and message/stream (#40305) 2026-09-08 15:56:52 -07:00
test_agent_rbac.py test: run the 30 test files stranded in the second mirror (#37595) 2026-08-20 10:59:43 -07:00
test_agent_registry.py fix(agents): redact secret litellm_params fields from all /v1/agents responses (#39389) 2026-09-02 14:28:44 -07:00
test_agent_search.py feat(skills): semantic search over the LiteLLM-hosted skill registry (#39401) 2026-09-07 12:28:38 -07:00
test_databricks_oauth.py Support OAuth M2M for Databricks Apps A2A agents (#29586) 2026-06-04 23:03:37 -07:00
test_endpoints.py fix(agents): hide agents from non-admins who were never granted them (#39636) 2026-09-03 14:40:36 -07:00
test_model_list_helpers.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00