Skip to content

fix: Chat Completions reasoning replay - #4432

Merged
seratch merged 1 commit into
mainfrom
fix/chat-completions-reasoning-replay
Aug 15, 2026
Merged

fix: Chat Completions reasoning replay#4432
seratch merged 1 commit into
mainfrom
fix/chat-completions-reasoning-replay

Conversation

@seratch

@seratch seratch commented Aug 15, 2026

Copy link
Copy Markdown
Member

This pull request fixes the Python Chat Completions adapter so that plaintext reasoning returned by OpenAI-compatible providers is preserved and replayed on its directly associated assistant message, matching the behavior introduced by openai/openai-agents-js#1669.

It supports streaming and non-streaming responses, assistant text and tool-call messages, and persisted session history. Replay is limited to the originating model and is invalidated by unrelated or intervening reasoning items.

Existing reasoning_content and thinking_blocks behavior remains unchanged. Empty and non-string values are ignored, and no public API is added.

@seratch seratch added this to the 0.21.x milestone Aug 15, 2026
@seratch seratch changed the title Fix Chat Completions reasoning replay fix: Chat Completions reasoning replay Aug 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42dc9b6f7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/models/chatcmpl_converter.py
@seratch
seratch force-pushed the fix/chat-completions-reasoning-replay branch from 42dc9b6 to 9ebb5ec Compare August 15, 2026 09:08
@seratch
seratch merged commit 60482a3 into main Aug 15, 2026
14 checks passed
@seratch
seratch deleted the fix/chat-completions-reasoning-replay branch August 15, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant