Skip to content

fix: include items for strict Zod v3 any arrays - #2357

Merged
HAYDEN-OAI merged 1 commit into
mainfrom
agent/fix-zod-v3-strict-any-array-items
Aug 15, 2026
Merged

HAYDEN-OAI merged 1 commit into
mainfrom
agent/fix-zod-v3-strict-any-array-items

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Summary

  • Include the required items schema when strict structured-output conversion encounters a Zod v3 array of z.any(), matching the existing Zod v4 output and strict-schema validation requirements.
  • Keep the existing parseDef path so described items retain metadata and named item definitions produce resolvable $ref values.
  • Preserve existing non-strict Realtime schemas and generic jsonSchema7, jsonSchema2019-09, and openApi3 converter output without changing typed or unknown arrays.

Regression coverage

  • All four strict public helper surfaces: zodResponseFormat, zodTextFormat, zodFunction, and zodResponsesFunction.
  • Nested and defaulted any arrays, described any items, named schemaDefinitions, existing strictifier rejection/acceptance, typed and unknown arrays, Realtime compatibility, and all three generic converter targets.
  • Regression-first baseline: 8 failing / 6 passing focused tests before the fix; 14 passing afterward.

Verification

  • pnpm test tests/helpers/zod-any-array-items.test.ts — 14 passed.
  • pnpm test:unit — 71 files / 2,104 tests passed.
  • pnpm lint — generated-file, formatting, and lint checks passed.
  • pnpm exec tsc --noEmit — passed with TypeScript 6.0.3.
  • pnpm build — production CommonJS/ESM build passed.
  • ./node_modules/typescript-4-9/bin/tsc --project dist/src/tsconfig.json --noEmit — passed with TypeScript 4.9.5.
  • ./node_modules/typescript/bin/tsc --project dist/src/tsconfig.json --noEmit — passed with TypeScript 6.0.3.
  • node --experimental-strip-types scripts/test-packed-package.ts — packed CommonJS/ESM consumers and TypeScript 4.9/current source checks passed across 1,200 source maps.
  • Built CommonJS and ESM Zod helper smoke tests confirmed strict v3/v4 parity, named-definition metadata/reference preservation, and unchanged non-strict output.

@openai-sdks

openai-sdks Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 237/237 SDK tests passed in 10.009s for Node SDK PR #2357.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 137ms
tests/chat-completions-create.test.ts ✅ Passed 184ms
tests/chat-completions-stream.test.ts ✅ Passed 178ms
tests/files-content-binary.test.ts ✅ Passed 124ms
tests/files-create-multipart.test.ts ✅ Passed 135ms
tests/files-list-pagination.test.ts ✅ Passed 164ms
tests/initialize-config.test.ts ✅ Passed 152ms
tests/instance-isolation.test.ts ✅ Passed 110ms
tests/models-list.test.ts ✅ Passed 134ms
tests/responses-background-lifecycle.test.ts ✅ Passed 186ms
tests/responses-body-method-errors.test.ts ✅ Passed 252ms
tests/responses-cancel-timeout.test.ts ✅ Passed 243ms
tests/responses-cancel.test.ts ✅ Passed 183ms
tests/responses-compact-retries.test.ts ✅ Passed 217ms
tests/responses-compact.test.ts ✅ Passed 191ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 102ms
tests/responses-create-advanced.test.ts ✅ Passed 239ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.215s
tests/responses-create-errors.test.ts ✅ Passed 157ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 172ms
tests/responses-create-retries.test.ts ✅ Passed 221ms
tests/responses-create-stream-failures.test.ts ✅ Passed 192ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.179s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.442s
tests/responses-create-stream.test.ts ✅ Passed 126ms
tests/responses-create-terminal-states.test.ts ✅ Passed 220ms
tests/responses-create-timeout.test.ts ✅ Passed 267ms
tests/responses-create.test.ts ✅ Passed 165ms
tests/responses-delete.test.ts ✅ Passed 112ms
tests/responses-input-items-errors.test.ts ✅ Passed 152ms
tests/responses-input-items-list.test.ts ✅ Passed 170ms
tests/responses-input-items-options.test.ts ✅ Passed 113ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 240ms
tests/responses-input-tokens-count.test.ts ✅ Passed 257ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.06s
tests/responses-not-found-errors.test.ts ✅ Passed 204ms
tests/responses-parse.test.ts ✅ Passed 178ms
tests/responses-retrieve-retries.test.ts ✅ Passed 270ms
tests/responses-retrieve.test.ts ✅ Passed 194ms
tests/responses-stored-method-errors.test.ts ✅ Passed 559ms
tests/retry-behavior.test.ts ✅ Passed 3.109s
tests/sdk-error-shape.test.ts ✅ Passed 246ms

View OkTest run #31855633356

SDK merge (db5fea55881c) · head (6710638c7ae3) · base (a3deafb5f91d) · OkTest (7e7850017529)

@jbeckwith-oai jbeckwith-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 6710638. No findings. The strict-only Zod v3 any-array items fix preserves parseDef metadata and references, matches v4, leaves non-strict and generic targets unchanged, and has focused coverage across all public helpers. Strict thermo is clean and exact CI is fully green.

@HAYDEN-OAI
HAYDEN-OAI added this pull request to the merge queue Aug 15, 2026
Merged via the queue into main with commit 4c32089 Aug 15, 2026
27 checks passed
@HAYDEN-OAI
HAYDEN-OAI deleted the agent/fix-zod-v3-strict-any-array-items branch August 15, 2026 02:18
@openai-sdks openai-sdks Bot mentioned this pull request Aug 15, 2026

This branch was previously deployed

1 inactive deployment
ci — 6710638c Deployed Aug 15, 2026 by HAYDEN-OAI via ecosystem tests #7889
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