Skip to content

refactor(node): share Responses output-text enrichment - #2443

Open
apcha-oai wants to merge 1 commit into
mainfrom
apcha/custom-code-burndown-node-responses-output-text
Open

refactor(node): share Responses output-text enrichment#2443
apcha-oai wants to merge 1 commit into
mainfrom
apcha/custom-code-burndown-node-responses-output-text

Conversation

@apcha-oai

Copy link
Copy Markdown
Contributor

Share the identical output-text enrichment callback used by Responses create and retrieve in the existing SDK-owned parser module. Keep both _thenUnwrap boundaries and the existing addOutputText implementation unchanged, preserving lazy parsing, response/stream identity, raw-response accessors, request IDs, request-option precedence, aggregation, errors, and public overloads.

The hash-verified public custom-code report keeps 32 mixed files and reduces total custom-patch lines 1,830 → 1,822. The Responses resource changes +139/−41 → +129/−43; the other 31 customizations are unchanged. No schema, compiler, API-reference, dependency, or generation-metadata changes.

All 36 new public-entrypoint characterization cases pass against both exact public main and this cleanup. Together with existing output-text/parser tests, 66 focused cases pass. Coverage includes lazy parsing, inherited/missing discriminators, malformed parser outputs, exact error identity, original input objects, option precedence, and real SSE streaming.

Validation: frozen pnpm 11.5.1 install; canonical formatting and full lint; TypeScript 6; build; TypeScript 4.9 published-source check; 619 of 621 existing declaration files byte-identical, with the remaining two containing only the additive helper declaration and its type imports (all pre-existing declarations unchanged); 5,376 handwritten tests, 556 generated tests and 12 snapshots (one skipped); packed CJS/ESM and source checks on Node 22.0.0; publint (only its existing vendored-export warning).

Focused parsing/compatibility review is requested for this behavior-preserving cleanup.

  • I understand that this repository is auto-generated and my pull request may not be merged.

Tracked as custom-code-burndown.

@apcha-oai
apcha-oai requested a review from a team as a code owner August 21, 2026 04:32
@apcha-oai apcha-oai added the custom-code-burndown Behavior-preserving reductions of custom code in generated SDK files label Aug 21, 2026
@openai-sdks

openai-sdks Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 10.844s for Node SDK PR #2443.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 154ms
tests/chat-completions-create.test.ts ✅ Passed 215ms
tests/chat-completions-stream.test.ts ✅ Passed 305ms
tests/files-content-binary.test.ts ✅ Passed 184ms
tests/files-create-multipart.test.ts ✅ Passed 198ms
tests/files-list-pagination.test.ts ✅ Passed 210ms
tests/initialize-config.test.ts ✅ Passed 182ms
tests/instance-isolation.test.ts ✅ Passed 134ms
tests/models-list.test.ts ✅ Passed 168ms
tests/responses-background-lifecycle.test.ts ✅ Passed 222ms
tests/responses-body-method-errors.test.ts ✅ Passed 324ms
tests/responses-cancel-timeout.test.ts ✅ Passed 190ms
tests/responses-cancel.test.ts ✅ Passed 191ms
tests/responses-compact-retries.test.ts ✅ Passed 235ms
tests/responses-compact.test.ts ✅ Passed 209ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 119ms
tests/responses-create-advanced.test.ts ✅ Passed 149ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.171s
tests/responses-create-errors.test.ts ✅ Passed 219ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 279ms
tests/responses-create-retries.test.ts ✅ Passed 238ms
tests/responses-create-stream-failures.test.ts ✅ Passed 271ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.206s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.598s
tests/responses-create-stream.test.ts ✅ Passed 99ms
tests/responses-create-terminal-states.test.ts ✅ Passed 266ms
tests/responses-create-timeout.test.ts ✅ Passed 197ms
tests/responses-create.test.ts ✅ Passed 259ms
tests/responses-delete.test.ts ✅ Passed 221ms
tests/responses-input-items-errors.test.ts ✅ Passed 246ms
tests/responses-input-items-list.test.ts ✅ Passed 276ms
tests/responses-input-items-options.test.ts ✅ Passed 121ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 212ms
tests/responses-input-tokens-count.test.ts ✅ Passed 226ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.336s
tests/responses-not-found-errors.test.ts ✅ Passed 278ms
tests/responses-parse.test.ts ✅ Passed 208ms
tests/responses-retrieve-retries.test.ts ✅ Passed 232ms
tests/responses-retrieve.test.ts ✅ Passed 239ms
tests/responses-stored-method-errors.test.ts ✅ Passed 496ms
tests/retry-behavior.test.ts ✅ Passed 3.24s
tests/sdk-error-shape.test.ts ✅ Passed 297ms

View OkTest run #32447323573

SDK merge (f310aef796eb) · head (1c264256bfd7) · base (0257e5130210) · OkTest (2b1bdfd25e98)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 21, 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-08-21T04:33:47.948727Z 1c26425 PR opened
🔒 Security Review Completed 2026-08-21T04:34:29.000632Z 1c26425 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.

@github-actions

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

32 mixed files remain; 1 existing customization changed.

Compared 0257e51302101c264256bfd7. Generated baselines verified.

File Result Current custom patch
src/resources/responses/responses.ts Existing customization changed +129 / −43
31 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/client.ts
  • src/resources/audio/transcriptions.ts
  • src/resources/audio/translations.ts
  • src/resources/beta/assistants.ts
  • src/resources/beta/beta.ts
  • src/resources/beta/index.ts
  • src/resources/beta/responses/internal-base.ts
  • src/resources/beta/responses/responses.ts
  • src/resources/beta/threads/index.ts
  • src/resources/beta/threads/runs/index.ts
  • src/resources/beta/threads/runs/runs.ts
  • src/resources/beta/threads/threads.ts
  • src/resources/chat/completions/completions.ts
  • src/resources/chat/completions/index.ts
  • src/resources/conversations/index.ts
  • src/resources/embeddings.ts
  • src/resources/files.ts
  • src/resources/fine-tuning/checkpoints/permissions.ts
  • src/resources/images.ts
  • src/resources/responses/internal-base.ts
  • src/resources/skills/skills.ts
  • src/resources/skills/versions/versions.ts
  • src/resources/vector-stores/file-batches.ts
  • src/resources/vector-stores/files.ts
  • src/resources/webhooks/index.ts
  • src/resources/webhooks/webhooks.ts
  • tests/lib/data-residency.test.ts

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 32447322860 --repo openai/openai-node \
  --name castiron-custom-code-32447322860-1 --dir /tmp/castiron-custom-code-32447322860-1
git apply --stat /tmp/castiron-custom-code-32447322860-1/custom-code.patch
cat /tmp/castiron-custom-code-32447322860-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 0257e513021012a052c6c06e10ae535f060663ea 1c264256bfd7da394153b2e7713fecb4990bc587
python3 scripts/castiron/custom_code_report.py report \
  --base 0257e513021012a052c6c06e10ae535f060663ea \
  --head 1c264256bfd7da394153b2e7713fecb4990bc587 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-1c264256bfd7
cat /tmp/castiron-custom-code-1c264256bfd7/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

custom-code-burndown Behavior-preserving reductions of custom code in generated SDK files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant