Repository navigation
Conversation
Preserve typed audio token usage at the SDK floor and current versions, close SSE spans deterministically, and scope Responses WebSocket support explicitly. Co-Authored-By: Claude Code <noreply@anthropic.com>
This was referenced Nov 2, 2026
nik13
added a commit
that referenced
this pull request
Nov 2, 2026
Require fi-instrumentation-otel 1.2.3 for OpenAI and vLLM, test built wheels, and preserve messages while hiding every legacy invocation-parameter copy. Finalize aclose on both routes without duplicating PR #411's shared close methods. Co-Authored-By: Claude Code <noreply@anthropic.com>
Preserve the audio transcription and gateway guides, and pin shared early-close tracing on the existing fix branch with a real-SDK regression at the supported floor and latest version. Co-Authored-By: Claude Code <noreply@anthropic.com>
Reconcile DeepSeek accumulator routing and explicit stream close. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
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
Keep
traceAI-openai: OpenAI Python does not expose a native GenAI OTel exporter that replaces this request instrumentor. Fix missing audio transcription usage through the existingOpenAIInstrumentorentry point rather than adding or deleting a package.gen_ai.operation.name=transcriptionbefore the request so failures retain their operation and requested model.close()as well as exhaustion and context exit. Retain only the terminal transcription event, not uploaded audio or a growing list of deltas. Existing context-manager error/cancellation behavior is preserved.responses.connect()WebSockets is not instrumented, and the separate Realtime package is not a substitute. Raw streaming-response wrappers, binary speech-download lifetimes and text/SRT/VTT transcription formats are outside this audio extraction contract.Evidence and design
On base
d6a9966dd4d5d5fb344f7f5ab11b7483c2c2a6bc, a real OpenAI client over a fake HTTP transport returned transcription usage 5/2/7 but emitted no normalized usage attributes on both SDK 1.69.0 and 3.42.0. The initial audio suite failed 42 cases on current and 34 on floor (eight unsupported diarized-format skips).Typed endpoint coverage follows the design demonstrated by Braintrust's explicit audio transcription integration; no vendor code was copied.
OpenAI's direct WebSocket path bypasses
OpenAI.request. Two fake-WebSocket regressions exercise the real sync/async SDK connections and assert that the HTTP instrumentor emits no spans, matching the documented boundary rather than claiming a nonexistent adapter.Verification
All local Python tests ran under the existing macOS sandbox denying outbound network except localhost. Vendor calls use
httpx.MockTransport; audio tests export real OTLP/HTTP protobuf to a localhost receiver. No vendor/model API, real credentials or Cloud collector was used.Full
python/frameworks/openai/testsresults:Floor skips cover unavailable diarized responses and Responses WebSockets. The locked-core run additionally skips the two echoed-error privacy cases because that core predates
hide_error_details; input/output masking and all usage tests still run. The current-core tests verify echoed errors are hidden on the wire. Existing 62 chat, Responses, embeddings, provider and context-manager tests remain green.Coverage includes sync/async, non-stream/stream, zero/missing/duration/malformed usage, early/empty context exit, explicit/repeated close, consumer errors/cancellation, HTTP errors, SSE API errors, and privacy checks against the serialized OTLP payload.
Re-run with dependencies installed, in a network-denied sandbox permitting localhost:
python -m pytest python/frameworks/openai/tests --noconftest -q -o addopts='' -p no:cacheproviderRelease and docs
No version or changelog bump; release-please owns the patch release. No package deletion, merge, tag or publish is part of this PR. A corrected website page is held until this package fix is on the registry; no docs PR claiming unreleased behavior has been opened. The package README includes the support boundary now. Python audio examples were executed offline at floor/current; the held MDX page compiles. No live screenshot or docs-site visual verification is claimed.
E2E coverage
not applicable (no e2e/ harness) · flows hit: n/a · marker: n/a · verdict: not applicable
Self-review: no introduced blocking finding. New tests and
git diff --checkpass; no Ruff configuration, migrations, frontend or contract-generation changes apply.🤖 Generated with Claude Code