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).
This commit is contained in:
teknium1
2026-09-15 12:06:25 -07:00
committed by Teknium
parent a12b3c7aa3
commit 51a2f4878f
@@ -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