Skip to content

[codex] reject empty AnyLLM Chat Completions responses - #4559

Closed
seanxuu wants to merge 1 commit into
openai:mainfrom
seanxuu:codex/anyllm-empty-chat-choices
Closed

[codex] reject empty AnyLLM Chat Completions responses#4559
seanxuu wants to merge 1 commit into
openai:mainfrom
seanxuu:codex/anyllm-empty-chat-choices

Conversation

@seanxuu

@seanxuu seanxuu commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What changed

This pull request fixes #4552 by making the AnyLLM Chat Completions path reject normalized responses with an empty choices list.

Why

AnyLLMModel._get_response_via_chat() previously treated an empty provider response as a successful ModelResponse(output=[]). The native Chat Completions adapter already raises ModelBehaviorError for this malformed response shape, so this change keeps the provider adapters consistent and prevents malformed responses from entering the runner as successful turns.

Validation

  • uv run pytest -q tests/models/test_any_llm_model.py -k any_llm_chat_path — 8 passed
  • uv run pytest -q tests/models/test_any_llm_model.py — 72 passed, 11 skipped
  • make format and make lint — passed
  • make typecheck and the full test suite were attempted; unrelated optional-dependency and existing extension/voice/runloop failures remain in the local environment.

Scope

The change is limited to the non-streaming AnyLLM Chat Completions path and its regression test. Responses, streaming, valid choices, and existing content-filter handling remain unchanged.

@seanxuu
seanxuu marked this pull request as ready for review August 21, 2026 02:53
@seratch seratch added the wontfix This will not be worked on label Aug 21, 2026
@seratch seratch closed this Aug 21, 2026
@seanxuu
seanxuu deleted the codex/anyllm-empty-chat-choices branch August 21, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AnyLLM Chat path accepts zero-choice completions as successful empty turns

2 participants