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

Function _record_stream_aborted

uncommon_route/proxy.py:5372–5389  ·  view source on GitHub ↗
(
                    stream_chunks: list[bytes] | None = None,
                )

Source from the content-addressed store, hash-verified

5370 stream_record_state["done"] = True
5371
5372 async def _record_stream_aborted(
5373 stream_chunks: list[bytes] | None = None,
5374 ) -> None:
5375 if stream_record_state["done"]:
5376 return
5377 try:
5378 await _spend_reservation.release(request_id)
5379 except Exception:
5380 pass
5381 _record_route_trace(
5382 status_code=499,
5383 streaming=True,
5384 error_code="client_disconnected",
5385 error_stage="stream",
5386 error_message="Client closed connection before stream finalized",
5387 stream_chunks=stream_chunks,
5388 )
5389 stream_record_state["done"] = True
5390
5391 async def _open_stream_attempt(attempt_payload: dict[str, Any]) -> httpx.Response:
5392 client = _get_client()

Callers 3

anthropic_native_sseFunction · 0.85
anthropic_sseFunction · 0.85
sse_passthroughFunction · 0.85

Calls 2

_record_route_traceFunction · 0.85
releaseMethod · 0.80

Tested by

no test coverage detected