refactor(node): share Responses output-text enrichment - #2443
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. |
Castiron custom code✅ No new custom-code files detected. 32 mixed files remain; 1 existing customization changed. Compared
31 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload 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.patchOr 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.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Share the identical output-text enrichment callback used by Responses
createandretrievein the existing SDK-owned parser module. Keep both_thenUnwrapboundaries and the existingaddOutputTextimplementation 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.
Tracked as
custom-code-burndown.