litellm/tests/test_litellm/passthrough
yucheng-berri 101f246fc5
fix(logging): classify allm_passthrough_route as async to prevent duplicate success callbacks (#32265)
* fix(logging): classify allm_passthrough_route as async to prevent duplicate success callbacks

Async passthrough requests set kwargs["allm_passthrough_route"]=True but that
flag is never propagated into litellm_params, and _is_sync_litellm_request only
checks acompletion/aresponses/aembedding/aimage_generation/atranscription.
Every async passthrough is misclassified as sync, which trips the CustomLogger
sync branch in success_handler and fires log_success_event in addition to the
async worker's async_log_success_event, causing 2-3 duplicate LangSmith runs
per Bedrock passthrough request

Propagate allm_passthrough_route through get_litellm_params and teach the
classifier about it. /chat/completions and other non-passthrough paths are
untouched

* test(passthrough): assert allm_passthrough_route flag propagates end-to-end

Integration-level guard on top of the unit tests in test_litellm_logging.py:
verifies that when kwargs["allm_passthrough_route"]=True enters
llm_passthrough_route, the flag survives get_litellm_params(**kwargs), lands
in the logging object's litellm_params, and _is_sync_litellm_request reads
the request as async

---------

Co-authored-by: yucheng <yucheng@yuchengs-MBP.localdomain>
2026-07-06 15:04:05 -07:00
..
__init__.py fix(passthrough): propagate Azure 429/5xx errors in async streaming instead of silent HTTP 200 (#22913) 2026-03-05 10:12:43 -08:00
test_async_streaming_error_propagation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_passthrough_main.py fix(logging): classify allm_passthrough_route as async to prevent duplicate success callbacks (#32265) 2026-07-06 15:04:05 -07:00
test_streaming_interrupt_spend_tracking.py refactor: trim explanatory comments from streaming-flush fix 2026-04-30 02:39:28 +00:00