mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-14 12:02:27 +08:00
The buffered Anthropic aggregators index finalResp.Content with the upstream content_block_delta index after checking only idx < len. A malformed or third-party Anthropic-compatible upstream that sends a negative index makes the request goroutine panic, so the client gets no response and the forward never returns a result to record usage. Add the lower bound in all four buffered aggregators (Chat Completions and Responses, on both the Anthropic gateway and the OpenAI native Anthropic paths); the out-of-range delta is skipped like an index past the end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>