Skip to content

fix: loading after ActiveSupport 6 subclass extensions - #346

Merged
jbeckwith-oai merged 6 commits into
mainfrom
codex/castiron-active-support-subclasses
Aug 9, 2026
Merged

fix: loading after ActiveSupport 6 subclass extensions#346
jbeckwith-oai merged 6 commits into
mainfrom
codex/castiron-active-support-subclasses

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

ActiveSupport 6 discovers subclasses with ==. OpenAI::Internal::Type::BaseModel defines structural equality, so calling BaseModel.subclasses while model aliases are still initializing can resolve an alias too early and raise NameError. The OpenAI-profile bootstrap now discovers direct subclasses through ObjectSpace and compares superclasses by identity, without modifying ActiveSupport or changing BaseModel#==.

This replaces #336, which manually carried only a reduced subset of the generated delta.

Closes #335.

Castiron provenance

  • Generator change: openai/openai#1237327, merged as 84b54ec48a12
  • Internal candidate: openai/openai-ruby-internal#16
  • Internal candidate head: 4965c116de69a80456c27ee029a64e0d13404ff0
  • Exact candidate tree: c1e65f76af4a6b652112f2f82f957ffbb59b9dca
  • Public/internal baseline: 7fd4f6c94bdafb669e23de48915d4465ec020215
  • Castiron generation ID: 05ef12b3-2068-40e2-949c-be1207c85819

The branch preserves the Castiron-generated checkpoint and merge history. The final handwritten commit strengthens the subprocess regression test by verifying a representative generated model still receives its OrHash alias.

Compatibility

  • Stainless-parity generation remains unchanged; the bootstrap divergence is gated to the OpenAI codegen profile.
  • Existing Ruby/ActiveSupport behavior is not monkey-patched.
  • The current-spec AuditLogListResponse#source field is additive, optional, and nullable.
  • Generated provenance, transformed OpenAPI, Ruby model, RBI, RBS, and generated resource-test changes are included together.

Validation

  • mise exec ruby@4.0.6 -- ./scripts/test — 515 runs, 1,692 assertions
  • mise exec ruby@4.0.6 -- bundle exec rake lint:rubocop — 2,596 files, no offenses
  • mise exec ruby@4.0.6 -- bundle exec rake typecheck:sorbet — no errors
  • mise exec ruby@4.0.6 -- bundle exec rake validate:rbs — 1,211 files
  • mise exec ruby@4.0.6 -- bundle exec rake build:gem — succeeded
  • Internal candidate CI, CodeQL, OkTest (237/237), Codex review, and security review all passed on the exact candidate head

Castiron Bot and others added 6 commits August 3, 2026 12:28
Generation metadata: ewogICJjb25maWd1cmF0aW9uX2NoZWNrcG9pbnRfc2hhIjogIjQ2N2Y1OThhOWIyYmIwNzM1Y2Y0NWMwMTQ0M2YwYTg0YjI2ZWEwM2IiLAogICJnZW5lcmF0ZWRfYmFzZWxpbmVfc2hhMjU2IjogIjdmYWM2NTI4ZGU4MGMzYzViMTY0YTg3N2I1MjY3NjAzYzE4ZDZjODc3NDllMTAwNDI5MmY0ZjlhZDE1YThiOGIiLAogICJnZW5lcmF0aW9uX2lkIjogIjYwY2FiYzdmLTMzYWQtNDEwNy04YzM5LTgxNTAwYTZjZDlhMSIsCiAgImlucHV0X2J1bmRsZV9kaWdlc3QiOiAiNzBkM2ZhYTI4YWEwMGIyNDFlNmFlNThiMDE5OTJlZGQ2YTVkNGJiNTUyYTI2Yzc4MTVjZGFiNGIzNjk5ZmZhNiIsCiAgImxhbmd1YWdlIjogInJ1YnkiLAogICJwcmV2aW91c19nZW5lcmF0aW9uX2lkIjogbnVsbCwKICAicHVibGljX2Jhc2VsaW5lX2NvbW1pdCI6ICI0OTFlYWNiZTU5YWE3NzU4NjczMWE3OTI5ZjQ4N2E0ZGNkNmY3MTEzIiwKICAic291cmNlX2JyYW5jaCI6ICJhcGNoYS1ncHQtNS01IiwKICAidGFyZ2V0IjogIm9wZW5haS1ydWJ5Igp9Cg==
Generation metadata: ewogICJjb25maWd1cmF0aW9uX2NoZWNrcG9pbnRfc2hhIjogImZlZDE0ZTNhYTIxODFkNzFhNGQzYzRhYzIyY2RkNzlkNmFkYTU3ZjQiLAogICJnZW5lcmF0ZWRfYmFzZWxpbmVfc2hhMjU2IjogIjFkYzg1NDU4NzY2YTBjZTc0ZGI3MmNkZGNjZjViN2NiNDNkMjljMDcxMmMzNzU5MWM0NzMzZDUwNTYwMmIwNjciLAogICJnZW5lcmF0aW9uX2lkIjogIjA1ZWYxMmIzLTIwNjgtNDBlMi05NDljLWJlMTIwN2M4NTgxOSIsCiAgImlucHV0X2J1bmRsZV9kaWdlc3QiOiAiYTZjYTdjOWI4MDIwOWNjZDhiNzUxOTBkMTNkNWNkNzczZjBhYzdjODNiODQ0YzJhMzE5NDMxNTYwODUxOWEwNSIsCiAgImxhbmd1YWdlIjogInJ1YnkiLAogICJwcmV2aW91c19nZW5lcmF0aW9uX2lkIjogIjYwY2FiYzdmLTMzYWQtNDEwNy04YzM5LTgxNTAwYTZjZDlhMSIsCiAgInB1YmxpY19iYXNlbGluZV9jb21taXQiOiAiN2ZkNGY2Yzk0YmRhZmI2NjllMjNkZTQ4OTE1ZDQ0NjVlYzAyMDIxNSIsCiAgInNvdXJjZV9icmFuY2giOiAiamJlY2t3aXRoL3J1YnktYWN0aXZlc3VwcG9ydC1zdWJjbGFzc2VzIiwKICAidGFyZ2V0IjogIm9wZW5haS1ydWJ5Igp9Cg==
@jbeckwith-oai
jbeckwith-oai marked this pull request as ready for review August 8, 2026 03:20
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner August 8, 2026 03:20
@openai-sdks

openai-sdks Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 10.87s for Ruby SDK PR #346.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 283ms
tests/chat-completions-create.test.ts ✅ Passed 303ms
tests/chat-completions-stream.test.ts ✅ Passed 160ms
tests/files-content-binary.test.ts ✅ Passed 236ms
tests/files-create-multipart.test.ts ✅ Passed 348ms
tests/files-list-pagination.test.ts ✅ Passed 183ms
tests/initialize-config.test.ts ✅ Passed 212ms
tests/instance-isolation.test.ts ✅ Passed 279ms
tests/models-list.test.ts ✅ Passed 307ms
tests/responses-background-lifecycle.test.ts ✅ Passed 277ms
tests/responses-body-method-errors.test.ts ✅ Passed 697ms
tests/responses-cancel-timeout.test.ts ✅ Passed 372ms
tests/responses-cancel.test.ts ✅ Passed 280ms
tests/responses-compact-retries.test.ts ✅ Passed 361ms
tests/responses-compact.test.ts ✅ Passed 269ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 184ms
tests/responses-create-advanced.test.ts ✅ Passed 216ms
tests/responses-create-disconnect.test.ts ✅ Passed 196ms
tests/responses-create-errors.test.ts ✅ Passed 485ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 262ms
tests/responses-create-retries.test.ts ✅ Passed 298ms
tests/responses-create-stream-failures.test.ts ✅ Passed 176ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 259ms
tests/responses-create-stream-wire.test.ts ✅ Passed 2.253s
tests/responses-create-stream.test.ts ✅ Passed 171ms
tests/responses-create-terminal-states.test.ts ✅ Passed 387ms
tests/responses-create-timeout.test.ts ✅ Passed 324ms
tests/responses-create.test.ts ✅ Passed 402ms
tests/responses-delete.test.ts ✅ Passed 338ms
tests/responses-input-items-errors.test.ts ✅ Passed 232ms
tests/responses-input-items-list.test.ts ✅ Passed 212ms
tests/responses-input-items-options.test.ts ✅ Passed 216ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 396ms
tests/responses-input-tokens-count.test.ts ✅ Passed 338ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.547s
tests/responses-not-found-errors.test.ts ✅ Passed 506ms
tests/responses-parse.test.ts ✅ Passed 248ms
tests/responses-retrieve-retries.test.ts ✅ Passed 301ms
tests/responses-retrieve.test.ts ✅ Passed 344ms
tests/responses-stored-method-errors.test.ts ✅ Passed 1.058s
tests/retry-behavior.test.ts ✅ Passed 2.024s
tests/sdk-error-shape.test.ts ✅ Passed 593ms

View OkTest run #31236988746

SDK merge (53d329147556) · head (4965c116de69) · base (7fd4f6c94bda) · OkTest (91635c6a2723)

@jbeckwith-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 4965c116de

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4965c116de

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@jbeckwith-oai jbeckwith-oai added the generator Touches generated SDK files label Aug 8, 2026
@jbeckwith-oai jbeckwith-oai changed the title Fix loading after ActiveSupport 6 subclass extensions fix: loading after ActiveSupport 6 subclass extensions Aug 8, 2026

@HAYDEN-OAI HAYDEN-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 exact head 4965c11 across the full diff, load-order path, BaseModel equality and alias contracts, and generated audit-log schema/runtime/type changes. No substantive correctness, compatibility, security, reliability, concurrency/resource, or maintainability issues found.

@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit 20fbb09 Aug 9, 2026
14 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the codex/castiron-active-support-subclasses branch August 9, 2026 18:29
@openai-sdks openai-sdks Bot mentioned this pull request Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

generator Touches generated SDK files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Library does not load when ActiveSupport 6 is included

2 participants