Skip to content

fix(types): parse steer responses when message type is omitted - #3794

Open
sylvesterkaczmarek wants to merge 6 commits into
openai:mainfrom
sylvesterkaczmarek:fix/steer-response-optional-message-type
Open

fix(types): parse steer responses when message type is omitted#3794
sylvesterkaczmarek wants to merge 6 commits into
openai:mainfrom
sylvesterkaczmarek:fix/steer-response-optional-message-type

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

The response.steer wire contract added in 3.8.0 allows a user message to omit its optional type field. response.steer.failed can return that original uncommitted input, but the generated response-side steer input model currently requires type and uses it as the discriminator for the message/tool-output union.

As a result, a failed steer event can be valid on the wire but fail SDK validation when the original user message omitted type.

This change:

  • makes the stable and beta steer message type optional;
  • removes the type discriminator from the two-variant response-side message/tool-output union so an omitted message discriminator can be parsed;
  • leaves the tool-output and caller variants unchanged.

Tests

Adds stable and beta regression coverage for response.steer.failed events that return a user message without type.

@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team as a code owner September 3, 2026 21:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T21:09:09.646543Z a43566b PR opened
🔒 Security Review Completed 2026-09-03T21:12:21.793076Z a43566b PR opened
ℹ️ 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.

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Making type optional requires dropping it as the union discriminator; otherwise valid failed-steer payloads cannot enter the message branch at all. The two branches still have disjoint required fields (role versus tool-output shape), so ordinary union validation remains well constrained. Stable and beta coverage is symmetric.

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