fix(types): parse steer responses when message type is omitted - #3794
sylvesterkaczmarek wants to merge 6 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
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.
a43566b to
89f2d23
Compare
|
Following up after the Group 6 maintenance pass. This branch is current with main, mergeable, and has no failing checks or unresolved review threads. Could a maintainer review it when convenient? |
Summary
The
response.steerwire contract added in 3.8.0 allows a user message to omit its optionaltypefield.response.steer.failedcan return that original uncommitted input, but the generated response-side steer input model currently requirestypeand 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:
typeoptional;typediscriminator from the two-variant response-side message/tool-output union so an omitted message discriminator can be parsed;Tests
Adds stable and beta regression coverage for
response.steer.failedevents that return a user message withouttype.