MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _record_stream_failure

Function _record_stream_failure

uncommon_route/proxy.py:5345–5370  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5343 stream_record_state["done"] = True
5344
5345 async def _record_stream_failure() -> None:
5346 await _spend_reservation.release(request_id)
5347 if is_virtual:
5348 _model_experience.observe(
5349 selected_model,
5350 mode_value,
5351 tier_value,
5352 success=False,
5353 )
5354 _circuit_breaker.record_failure(selected_model)
5355 _record_route_trace(
5356 status_code=502,
5357 streaming=True,
5358 error_code="stream_failure",
5359 error_stage="stream",
5360 error_message="Streaming response interrupted",
5361 )
5362 else:
5363 _record_route_trace(
5364 status_code=502,
5365 streaming=True,
5366 error_code="stream_failure",
5367 error_stage="stream",
5368 error_message="Streaming response interrupted",
5369 )
5370 stream_record_state["done"] = True
5371
5372 async def _record_stream_aborted(
5373 stream_chunks: list[bytes] | None = None,

Callers 3

anthropic_native_sseFunction · 0.85
anthropic_sseFunction · 0.85
sse_passthroughFunction · 0.85

Calls 4

_record_route_traceFunction · 0.85
releaseMethod · 0.80
observeMethod · 0.80
record_failureMethod · 0.45

Tested by

no test coverage detected