From 9c41214b0cad08524b458696b02a46dfb4df7f99 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 00:57:46 +0000 Subject: [PATCH] test(guardrails): expect the content_filter finish on a blocked chat stream (#51281) Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/integration/observability/test_guardrail_effects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/observability/test_guardrail_effects.py b/tests/integration/observability/test_guardrail_effects.py index 5d3ab4474ad..4f1ab570d29 100644 --- a/tests/integration/observability/test_guardrail_effects.py +++ b/tests/integration/observability/test_guardrail_effects.py @@ -1637,7 +1637,7 @@ def test_chat_pre_call_denial_streams_content_filter(gateway: Gateway, tmp_path: assert lines[-1] == "data: [DONE]", response.text chunks: Final = tuple(json.loads(line.removeprefix("data: ")) for line in lines[:-1]) assert chunks[0]["choices"][0]["delta"]["content"] == _RESPONSES_DENIAL, chunks - assert chunks[-1]["choices"][0]["finish_reason"] == "stop", chunks + assert chunks[-1]["choices"][0]["finish_reason"] == "content_filter", chunks @pytest.mark.covers("other.observability.guardrails.chat_pre_call_denial_returns_content_filter")