Repository navigation
fix(openai): repair recalled TypeScript SDK contracts - #535
Merged
Merged
Conversation
Handle custom tools and optional Responses inputs, protect duplicate private payloads, and preserve stream abort, failure and usage semantics. Add floor/latest SDK and shared-core regressions. Co-Authored-By: Claude Code <noreply@anthropic.com>
Protect stored-prompt inputs and MCP credentials in all telemetry copies. Integrate the shared structured-message redactor and tests from #416 at 8630636 while preserving duplicate-payload masking. Aggregate function/custom deltas by SDK index without overwriting request model metadata. Run core Jest directly inside network-isolated CI. Co-Authored-By: Claude Code <noreply@anthropic.com>
Mask prediction/suffix content, preserve screenshot structure and request models, select streamed choice zero by SDK index, and declare the directly imported OTel core dependency. Cover real SDK bounds and strict non-hoisted CJS/ESM imports. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
…m tools Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow up on all nine findings from the independent recall of merged #488. Keep the maintained shared TypeScript OpenAI instrumentor and preserve SDK objects, promise helpers, transport payloads and cancellation behavior.
function; accept Responses stored-prompt requests withoutinput.Independent review round 1 fixes
8630636b3d80e6b8cefdf85e41b1d9da8e88e344, retaining this PR's raw/value and embedding rules. Text hiding now covers custom-tool payloads too; combined flags fail closed.The independent review's seven findings were reproduced before fixes: 4 failing endpoint probes on SDK 4.0.0 and 18 failures/1 passing control on SDK 7.47.0 after expanding transport/privacy controls; the companion native-message suite had 73 failures/15 passes. All now pass. Empty-cache Corepack also reproduced the CI bootstrap failure; direct Jest passes in the same isolated environment.
Independent review round 2 fixes
n=2choices plus usage-only chunks.@opentelemetry/coreimport as a runtime dependency (aligned with core at^2.0.1). Add clean non-hoisted pnpm consumers and isolated CJS/ESM import tests to every SDK matrix job.All five findings reproduced before fixes: floor endpoint probes had 6 failures, latest had 11 failures and 1 passing control; both strict CJS/ESM imports failed with the missing direct dependency. Expanded final probes now pass, including capture-enabled controls, string/array predictions, URL/file screenshots and unchanged caller/transport/SDK payloads. Existing mock streams now declare the required choice index; their output-content expectations were not weakened.
Reproduction and tests
On unmodified dev
7cb1d3e42d9e3f80f3f80dc51a87417acdeb0c67, the original real-SDK recall suites reproduced 12 failures / 5 passes on 4.0.0 and 17 failures / 5 passes on 7.47.0 before fixes. These failures cover all nine recall findings. The committed expanded tests also cover listener cleanup, repeated/pre-iteration abort, hidden deadline/provider errors, failed/incomplete streamed Responses, returned SDK payload equality, custom-tool attributes and stream metadata.Final local results (all runtime tests/builds inside the assigned macOS sandbox denying outbound networking; synthetic fetch or loopback HTTP/OTLP only):
git diff --check, and release-plan consistency check pass (129 packages).Release and overlap
The shared privacy fixes require both the core and OpenAI patch releases. Release core first, then OpenAI; upgrade both packages together. README commands no longer pin the old core. This PR does not publish packages, bump versions, edit changelogs, merge anything, or claim a live vendor/Cloud test.
Checked existing open PRs before implementation. #410 concerns already-integrated API-promise mechanics, not these recall findings. #520 fixes Python Responses, not TypeScript. #416 fixes native GenAI/structured-message masking. Round 1 now integrates its existing implementation/tests rather than relying on an unmerged companion, preserving this PR's separate raw/value and embedding rules. #416 itself was not merged or modified; reconcile this overlap when landing it. MCP credential fields are removed here, while arbitrary customer tool descriptions/custom attributes remain outside general content-hiding guarantees.
Standards self-review
Traced the changed request, response, privacy, abort and streaming aggregation paths against the contracts/types, correctness, performance, failure modes, testing, security and PR-shape checklist. The newly declared runtime dependency repairs a verified direct-import resolution failure; no provider replacement, copied customer tracing glue, or duplicate spans. No Python, migration, frontend, application authz or OSS/EE boundary change; those mechanical gates do not apply. Independent review is still required.
E2E coverage
not applicable (no application e2e/ harness) · flows hit: n/a · marker: n/a · verdict: not applicable. Re-runnable package contracts and real SDK/OTLP regressions are committed in this PR.
Independent recall, round 3
tool_search_outputauthorization/headers without modifying caller objects, SDK transport requests or returned data. Invalid URLs fail closed.devinto this existing branch with a normal merge commit; no new PR or force push. Independent review and merge gate remain outstanding.🤖 Generated with Claude Code