fix: map Gemini blocked finish reasons to content_filter
Gemini replies that Google blocks with BLOCKLIST, PROHIBITED_CONTENT, SPII or IMAGE_SAFETY were reported to clients as a normal stop.
Root cause
mapFinishReason in google-adapter.ts only mapped SAFETY and RECITATION to content_filter; every other blocking reason fell through to the ?? 'stop' default, so clients saw an empty reply that looked like a successful completion (non-streaming and streaming both use this function).
Fix
Add the four missing blocking reasons to the map as content_filter, plus a patch changeset.
Test
google-adapter.spec.ts: a parametrised test for the four reasons. It fails (4 failures) before the change and passes after; the whole spec file is green (138 tests).
This change was prepared with the assistance of an AI coding agent (Claude).
Summary by cubic
Fixes Gemini replies blocked by Google for BLOCKLIST, PROHIBITED_CONTENT, SPII, or IMAGE_SAFETY being reported to clients as a normal stop instead of content_filter.
- Adds the four missing blocking reasons to
mapFinishReasoningoogle-adapter.tsso both streaming and non-streaming responses report them ascontent_filter. - Adds a parametrised test covering all four reasons.
- Includes a patch changeset in
manifest.