From 8fa8aabbbbb1f5f65ad44d747527dfcd9b7a4866 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 15 Jul 2026 04:27:32 -0700 Subject: [PATCH] test(codex): pin codex_backend issuer in xai-scoped salvage test (#64844) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_normalize_codex_response_salvage_is_xai_scoped broke on main when two same-day merges crossed: #64764 (#64434 — trust response.status for reasoning-only turns on UNRECOGNIZED Responses backends) changed what a bare _normalize_codex_response(response) call returns for status='completed' reasoning-only output (now 'stop'), while #64768 added this test calling with no issuer_kind and expecting 'incomplete'. The test's intent is that the xAI reasoning-channel salvage does not leak into other special-cased backends — pin issuer_kind='codex_backend' so it exercises exactly that (same pattern as test_normalize_codex_response_treats_summary_only_reasoning_as_incomplete, which was already pinned for #64434). --- tests/agent/test_codex_responses_adapter.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/agent/test_codex_responses_adapter.py b/tests/agent/test_codex_responses_adapter.py index 4a14cadf4a3d..cbf2f0e58b61 100644 --- a/tests/agent/test_codex_responses_adapter.py +++ b/tests/agent/test_codex_responses_adapter.py @@ -493,14 +493,21 @@ def test_normalize_codex_response_salvage_strips_closing_tag(): def test_normalize_codex_response_salvage_is_xai_scoped(): - """Non-xAI issuers keep the reasoning-only → incomplete classification; - the Codex backend replays encrypted reasoning, so its continuation - genuinely progresses and must not be short-circuited.""" + """Non-xAI special-cased issuers (Codex backend) keep the reasoning-only → + incomplete classification; the Codex backend replays encrypted reasoning, + so its continuation genuinely progresses and must not be short-circuited. + + Pins ``issuer_kind="codex_backend"`` explicitly: with no issuer at all, + the unrecognized-backend rule (#64434) trusts ``status="completed"`` and + returns ``stop`` — that path is covered by the #64434 regression tests. + """ response = _xai_reasoning_only_response( "Thinking.\nThe answer." ) - assistant_message, finish_reason = _normalize_codex_response(response) + assistant_message, finish_reason = _normalize_codex_response( + response, issuer_kind="codex_backend" + ) assert finish_reason == "incomplete" assert assistant_message.content == ""