fix: replace assert with RuntimeError and fix return type annotation

- a2a_protocol/main.py: replace bare assert with descriptive RuntimeError
  in _execute_a2a_send_with_retry so retry exhaustion gives a clear message
- fine_tuning/main.py: fix _resolve_fine_tuning_timeout return type from
  float to Union[float, httpx.Timeout] to accurately reflect the passthrough path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Julio Quinteros
2026-03-05 06:38:38 -03:00
co-authored by Claude Sonnet 4.6
parent b3bbcd3955
commit 0133d11eb2
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -198,7 +198,10 @@ async def _execute_a2a_send_with_retry(
continue
except Exception:
raise
assert a2a_response is not None
if a2a_response is None:
raise RuntimeError(
"A2A send_message failed: no response received after retry attempts."
)
return a2a_response
+2 -2
View File
@@ -129,13 +129,13 @@ async def acreate_fine_tuning_job(
def _resolve_fine_tuning_timeout(
timeout: Any,
custom_llm_provider: str,
) -> float:
) -> Union[float, httpx.Timeout]:
"""Normalise a raw timeout value to a float (seconds) for fine-tuning calls."""
timeout = timeout or 600.0
if isinstance(timeout, httpx.Timeout):
if not supports_httpx_timeout(custom_llm_provider):
return float(timeout.read or 600)
return timeout # type: ignore[return-value]
return timeout
return float(timeout)