From 51a2f4878f7af67988fc6bfd1e96fd4b1fcf9456 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Tue, 15 Sep 2026 12:06:25 -0700 Subject: [PATCH] test: pin the non-SDK facade gate alongside the escape hatch The MoA aggregator and test stand-ins never merge extra_body; the bypass must hand them the kwargs untouched or the conversation would be sent empty. Fold that control into the existing rail test (still two tests). --- tests/agent/test_chat_sdk_transform_bypass.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/agent/test_chat_sdk_transform_bypass.py b/tests/agent/test_chat_sdk_transform_bypass.py index 685030a43e..f54ca4f795 100644 --- a/tests/agent/test_chat_sdk_transform_bypass.py +++ b/tests/agent/test_chat_sdk_transform_bypass.py @@ -90,9 +90,14 @@ def test_bulk_fields_ride_in_extra_body_and_the_wire_bytes_are_identical(): assert recorder.send(moved) == recorder.send(dict(body)) -def test_escape_hatch_restores_the_typed_sdk_path(monkeypatch): - monkeypatch.setenv(ESCAPE_HATCH_ENV, "1") +def test_escape_hatch_and_non_sdk_facades_keep_the_typed_path(monkeypatch): + """Both rails hand the kwargs back untouched: the env hatch, and a chat-shaped facade + that is not the SDK (MoA aggregator, test stand-ins) — it never merges ``extra_body``.""" recorder = _Recorder() kwargs = _wire_body() + facade = types.SimpleNamespace(chat=types.SimpleNamespace(completions=types.SimpleNamespace(create=lambda **kw: kw))) + assert bypass_chat_sdk_request_transform(kwargs, facade) is kwargs + + monkeypatch.setenv(ESCAPE_HATCH_ENV, "1") assert bypass_chat_sdk_request_transform(kwargs, recorder.client) is kwargs