fix: release stream reader locks on normal completion, skip unread clone (#382)
teeStream and createAnthropicTerminalRecoveryStream only released their upstream reader's lock on the cancel/error teardown paths, never on normal done-completion — the 96%+ traffic case. Both wrap every native Anthropic-Messages SSE response and every proxied response body. OpenAICompatibleProvider.extractUsageInfo cloned the response before checking content-type, then returned null unread for SSE bodies, leaving that clone's tee branch open on every OpenAI-compatible streaming response. The clone now only happens on the JSON branch that actually consumes it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
T
tombii committed
befee2512980f245b28291530700c65eb0e23541
Parent: 4a8efaf