fix(anthropic): annotate the error-chunk builder for the type-discipline gate

_make_error_chunk returns a dict because the chunk is appended to
_chunk_queue and returned from __anext__, both of which are typed
dict[str, Any] by the existing iterator contract in this file. Record
that with a mutable-ok reason so the LIT001 budget stays flat.
This commit is contained in:
David-Wu1119 2026-08-13 18:01:06 +08:00
parent a3b139e086
commit d711cfbc84

View file

@ -124,7 +124,9 @@ class AnthropicResponsesStreamWrapper:
self._current_block_index += 1
return self._current_block_index
def _make_error_chunk(self, message: str) -> dict[str, Any]:
def _make_error_chunk(
self, message: str
) -> dict[str, Any]: # mutable-ok: queued into _chunk_queue and returned from __anext__, both typed dict[str, Any]
return {
"type": "error",
"error": {"type": "api_error", "message": message},