Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: use ResponseOutputRefusal for refusal content part added event#2013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
seratch merged 1 commit intoopenai:mainfrommshsheikh:patch-35
Oct 31, 2025

Conversation

@mshsheikh
Copy link
Contributor

In the refusal handling branch, theResponseContentPartAddedEvent was incorrectly usingResponseOutputText as thepart payload.
This violates the OpenAI Agents protocol, which requires refusal content to be represented byResponseOutputRefusal so that downstream consumers can access the.refusal field.

This change updates thepart field to useResponseOutputRefusal(refusal="", type="refusal"), ensuring type consistency with both the accumulated state and the correspondingResponseContentPartDoneEvent.

Additionally, theoutput_index calculation is slightly improved for clarity by explicitly using(1 if state.reasoning_content_index_and_output else 0) instead of a boolean expression, though the primary fix is the payload type correction.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
In the refusal handling branch, the `ResponseContentPartAddedEvent` was incorrectlyusing `ResponseOutputText` as the `part` payload. This violates the OpenAI Agentsprotocol, which requires refusal content to be represented by `ResponseOutputRefusal`so that downstream consumers can access the `.refusal` field.This change updates the `part` field to use `ResponseOutputRefusal(refusal="", type="refusal")`,ensuring type consistency with both the accumulated state and the corresponding`ResponseContentPartDoneEvent`.Additionally, the `output_index` calculation is slightly improved for clarity byexplicitly using `(1 if state.reasoning_content_index_and_output else 0)` instead ofa boolean expression, though the primary fix is the payload type correction.This is a safe, minimal, and high-impact fix that aligns the stream handler withthe official response schema.
@seratch
Copy link
Member

@codex review

@chatgpt-codex-connector

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ 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".

@seratchseratch merged commit0c4f2b9 intoopenai:mainOct 31, 2025
9 checks passed
@seratchseratch added this to the0.5.x milestoneNov 5, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@seratchseratchseratch approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

0.5.x

Development

Successfully merging this pull request may close these issues.

2 participants

@mshsheikh@seratch

[8]ページ先頭

©2009-2025 Movatter.jp