Skip to content

fix(api): preserve unknown Java union value identity - #1301

Merged
jbeckwith-oai merged 1 commit into
mainfrom
castiron/promotions/pr-391
Oct 28, 2026
Merged

jbeckwith-oai merged 1 commit into
mainfrom
castiron/promotions/pr-391

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Summary

Unknown union values with different JSON payloads currently compare equal and collapse in sets and maps. Use raw JSON for equals and hashCode when no recognized variant is active, preserving existing equality for recognized variants.

Changes

  • Preserve distinct unknown payloads across top-level and nested unions.
  • Keep builder-created and deserialized recognized values equal with matching hashCode values.

@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner October 28, 2026 18:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-10-28T19:28:55.521340Z 982a90f New commits
🔒 Security Review ✅ Completed 2026-10-28T19:29:04.627751Z 982a90f New commits
ℹ️ 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 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: 66aee13d12

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

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 212e57ae00f1dda78ac082866c2b76875b3cf5a4. No changes requested.

Unknown union payloads now retain their identity in sets and maps. Known variants keep their existing equality and hash behavior. The fix covers all 513 changed identity implementations, including the SDK-owned embedding and legacy Realtime unions. The added tests check unknown-value round trips and known factory/decoded-value equality.

Source-only review with an independent pass across all 318 files. No candidate code, builds or tests ran locally. Hosted CI was still pending in the captured snapshot; the local test totals in the PR remain author-reported.

Castiron-Internal-PR: openai/openai-java-internal#391
Castiron-Source-SHA: f2a077fd8c46359ae4db8b8a61fe949f08e7f7f7
Castiron-Public-Base-SHA: ccb201d
@jbeckwith-oai
jbeckwith-oai force-pushed the castiron/promotions/pr-391 branch from 212e57a to 982a90f Compare October 28, 2026 19:26
@jbeckwith-oai
jbeckwith-oai requested review from a team, dpiet-oai and markstuart-oai October 28, 2026 19:37
@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit de0e061 Oct 28, 2026
14 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Oct 28, 2026
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.

3 participants