mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(a2a): replace bare assert with descriptive RuntimeError on retry exhaustion
If both retry attempts in asend_message absorb A2ALocalhostURLError silently, the bare assert would fire as AssertionError with no context. Replace with a RuntimeError that includes the request_id for easier debugging. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9a13c76e2f
commit
0d689e9711
1 changed files with 5 additions and 2 deletions
|
|
@ -314,8 +314,11 @@ async def asend_message(
|
|||
|
||||
verbose_logger.info(f"A2A send_message completed, request_id={request.id}")
|
||||
|
||||
# a2a_response is guaranteed to be set if we reach here (loop breaks on success or raises)
|
||||
assert a2a_response is not None
|
||||
if a2a_response is None:
|
||||
raise RuntimeError(
|
||||
"A2A send_message failed: no response received after retry attempts. "
|
||||
f"request_id={request.id}"
|
||||
)
|
||||
|
||||
# Wrap in LiteLLM response type for _hidden_params support
|
||||
response = LiteLLMSendMessageResponse.from_a2a_response(a2a_response)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue