Skip to content

fix(models): surface non-streaming content-filter refusals - #4188

Merged
seratch merged 2 commits into
mainfrom
fix/chat-completions-content-filter-refusal
Aug 5, 2026
Merged

fix(models): surface non-streaming content-filter refusals#4188
seratch merged 2 commits into
mainfrom
fix/chat-completions-content-filter-refusal

Conversation

@seratch

@seratch seratch commented Aug 5, 2026

Copy link
Copy Markdown
Member

This pull request takes over the fix originally proposed in #4159.

It fixes non-streaming Chat Completions responses that report finish_reason="content_filter" but contain no text, refusal, or tool calls. It converts that otherwise empty provider signal into the same explicit ResponseOutputRefusal used by the streaming and LiteLLM paths, while preserving partial text, provider-supplied refusals, tool calls, and ordinary empty completions.

The original contributor is credited through the commit's Co-authored-by trailer.

Co-authored-by: LeSingh1 <sshaurya914@gmail.com>
@seratch seratch added this to the 0.19.x milestone Aug 5, 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: ff294cf765

ℹ️ 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/openai_chatcompletions.py
@seratch
seratch enabled auto-merge (squash) August 5, 2026 01:20
@seratch
seratch merged commit 36829b6 into main Aug 5, 2026
9 checks passed
@seratch
seratch deleted the fix/chat-completions-content-filter-refusal branch August 5, 2026 01:22
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