#27955 [Bug]: max_parallel_requests not reliable with anthropic adapter
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
Hello,
`max_parallel_requests` counter in Redis monotonically increases when clients cancel streaming `/v1/messages` requests mid-stream. Eventually every request hits Limit type: `max_parallel_requests. Current limit: N, Remaining: 0.`
## Root cause Claude Code's per-turn pattern sends two HTTP POSTs to /v1/messages:
- POST A: stream: true (speculative streaming) - POST B: stream: false (confirmation)
As soon as POST B's response starts arriving, Claude Code cancels POST A mid-stream. The cancellation propagates as asyncio.CancelledError into: ``` proxy/utils.py :: ProxyLogging.async_post_call_streaming_iterator_hook async for chunk in current_response: yield chunk # ā post-loop code (never reached on cancel) ``` `pre_call_hook` already incremented `max_parallel_requests` (+1) on entry. The success-event decrement (-1) is fired only when the stream completes naturally ā via `CustomStreamWrapper.__anext__`'s terminal `StopAsyncIteration` branch (line 2208 of `litellm_core_utils/streaming_handler.py`) or via the dā¦