litellm/tests/unit/interactions
joshua-berri 563dfd5075
fix(interactions): bind Deep Research agents and record their costs (#51517)
* fix(interactions): bind Deep Research agents to their deployment and bill the agent

A request that sends an agent with a model group now sends the agent to Google
and is refused with a 400 unless the group's deployment is that agent. Agent
interactions are logged and priced under the agent, including streamed and
background jobs, with a Vertex cost row for deep-research-preview-04-2026.
Background cost polling now waits 7800 seconds by default so a 120-minute job
still settles.

* fix(interactions): refuse extra_body that changes the agent or model

A nested agent or model in extra_body was merged into the request after the agent binding check, so it could run a different agent than the one billed, inject an agent onto a model deployment, or add a second selector. Refuse those before any provider or OAuth call, while identical agent repeats and unrelated extra_body fields still pass through.

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>
2026-11-13 00:20:53 -08:00
..
__init__.py test: move tests/test_litellm root and small trees into tests/unit (#43186) 2026-09-25 11:30:43 -07:00
conftest.py test(interactions): read the spec from a vendored snapshot and canary the live one daily (#48002) 2026-10-23 17:20:40 +00:00
interactions.openapi.json feat(interactions): forward continuation_token and type requires_continuation so callers can resume a long decode (#50151) 2026-11-05 15:38:44 -08:00
test_agents_http_handler.py fix(gemini)!: accept Google's current Managed Agents fields on create and interactions (#48750) 2026-10-28 12:37:59 -07:00
test_agents_main_and_utils.py fix(gemini)!: accept Google's current Managed Agents fields on create and interactions (#48750) 2026-10-28 12:37:59 -07:00
test_background_cost_polling.py fix(interactions): bind Deep Research agents and record their costs (#51517) 2026-11-13 00:20:53 -08:00
test_gemini_interactions_transformation.py refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
test_interactions_streaming_iterator.py fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00
test_litellm_responses_bridge.py refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
test_main.py fix(interactions): bind Deep Research agents and record their costs (#51517) 2026-11-13 00:20:53 -08:00
test_openapi_compliance.py feat(interactions): forward continuation_token and type requires_continuation so callers can resume a long decode (#50151) 2026-11-05 15:38:44 -08:00