Skip to content

Serialize reasoning-only assistant messages with content - #1494

Closed
willccbb wants to merge 1 commit into
mainfrom
codex/openai-reasoning-content-empty-string
Closed

Serialize reasoning-only assistant messages with content#1494
willccbb wants to merge 1 commit into
mainfrom
codex/openai-reasoning-content-empty-string

Conversation

@willccbb

@willccbb willccbb commented May 30, 2026

Copy link
Copy Markdown
Member

Summary

  • send empty string content when replaying reasoning-only assistant messages to OpenAI-compatible chat completions providers
  • preserve reasoning_content on the replayed assistant message
  • add regression coverage for the prompt normalization case
  • bump verifiers to 0.1.15.dev15 so cookbook evals can consume the fix

Tests

  • uv run ruff check verifiers/clients/openai_chat_completions_client.py tests/test_client_multimodal_types.py verifiers/init.py
  • uv run ty check verifiers/clients/openai_chat_completions_client.py
  • uv run pytest tests/test_client_multimodal_types.py -q

Note

Low Risk
Narrow prompt-serialization change with a targeted regression test; no auth, data, or API surface changes beyond message shaping.

Overview
Fixes replay of reasoning-only assistant turns when building OpenAI-compatible chat completion prompts: if content is missing and there are no tool calls but reasoning_content is set, the client now sends content="" instead of leaving content unset, while still passing through reasoning_content.

Adds a regression test in test_client_multimodal_types.py and bumps the package to 0.1.15.dev15.

Reviewed by Cursor Bugbot for commit 9c167f9. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Serialize reasoning-only assistant messages with empty string content in to_native_prompt

When an AssistantMessage has content=None, no tool calls, and reasoning_content set, openai_chat_completions_client.py previously passed None as the content field. It now passes an empty string instead, satisfying the OpenAI API requirement that assistant messages with reasoning content have a non-null content value.

Macroscope summarized 9c167f9.

@willccbb

Copy link
Copy Markdown
Member Author

Closing per maintainer direction: this touches verifiers core, and this task should stay isolated to tasksets.

@willccbb willccbb closed this May 30, 2026
@willccbb
willccbb deleted the codex/openai-reasoning-content-empty-string branch May 30, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant