Skip to content

Studio: stop OpenAI chats failing on earlier replies sent as parts - #16945

Merged
danielhanchen merged 1 commit into
unslothai:mainfrom
NilayYadav:openai-assistant-output-text
Nov 7, 2026
Merged

danielhanchen merged 1 commit into
unslothai:mainfrom
NilayYadav:openai-assistant-output-text

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

OpenAI chats failed with "Invalid value: 'input_text'. Supported values are: 'output_text' and 'refusal'" whenever an earlier assistant reply reached the Responses API as a list of content parts instead of a plain string. This happens in Studio after OpenAI compaction resets the conversation state, and for any client of the OpenAI-compatible chat endpoint that sends assistant messages as parts. Assistant text was labelled as user input, and assistant images as input images, which OpenAI rejects on assistant turns.

Assistant text parts are now sent as output text, both on plain replies and on replies that made tool calls. Image parts on assistant turns are left out, since OpenAI has no way to accept them there, so the rest of the conversation still goes through. User messages are sent exactly as before.

@NilayYadav NilayYadav self-assigned this Nov 6, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T21:33:21.008450Z 041eb95 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 041eb95bee

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

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.

2 participants