Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/agent/test_codex_responses_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.\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 assistant_message.content == ""
Expand Down
Loading