test(codex): pin codex_backend issuer in xai-scoped salvage test (#64844)
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).fix/verification-admin-route-recovery
parent
1b059d1ae7
commit
8fa8aabbbb
|
|
@ -493,14 +493,21 @@ def test_normalize_codex_response_salvage_strips_closing_tag():
|
||||||
|
|
||||||
|
|
||||||
def test_normalize_codex_response_salvage_is_xai_scoped():
|
def test_normalize_codex_response_salvage_is_xai_scoped():
|
||||||
"""Non-xAI issuers keep the reasoning-only → incomplete classification;
|
"""Non-xAI special-cased issuers (Codex backend) keep the reasoning-only →
|
||||||
the Codex backend replays encrypted reasoning, so its continuation
|
incomplete classification; the Codex backend replays encrypted reasoning,
|
||||||
genuinely progresses and must not be short-circuited."""
|
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(
|
response = _xai_reasoning_only_response(
|
||||||
"Thinking.\n<response>The answer.</response>"
|
"Thinking.\n<response>The answer.</response>"
|
||||||
)
|
)
|
||||||
|
|
||||||
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 finish_reason == "incomplete"
|
||||||
assert assistant_message.content == ""
|
assert assistant_message.content == ""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue