Repository navigation
Conversation
Shared @traceai/provider-media helper plus thin bindings for Gemini (three wrappers), Bedrock Converse, compatible chat messages and OpenAI/Groq speech. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop the OpenAI chat capture line: the OpenAI chat adapter owns that hook. - OpenAI audio spans exist only while an attachment manager is active, and speech capture is limited to qualified audio hosts. - One part budget per data URI, Bedrock typed tool-result image/PDF blocks, explicit per-package capability descriptors. - New provider-media workflow (unit + real SDKs against loopback) and stage the helper tarball in workflows that install packed packages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Mistral typed image chunks start at 1.1.0 (1.0.0 is the legacy client). - Older OpenAI shims pass node-fetch options; the loopback redirect drops them. - Newer Bedrock clients default to HTTP/2; the fixture uses an HTTP/1.1 handler. - Run each SDK tier in its own process (Vertex keeps process-wide patch state). - Pin the latest qualified SDK releases for reproducible CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ch input Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vertise it Groq chat is image-only, so its descriptor and behaviour now agree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…entry The shared helper lived at typescript/packages/traceai_provider_media, so the @traceai/auto registry test counted it as an instrumentation (52 vs 51). Move it to typescript/packages/provider-media, beside fi-core, and update the tsconfig references, workflow paths and lockfile importer. The package is publishable, so release_plan.py inventories it; add its release-please config and manifest entry (0.1.0) so the Release gates pass and npm_release.py can resolve it as a dependency. Nothing is published by this. Add test/layout.test.cjs as the regression test for both, run from the package test script and the provider-media workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-media pnpm install --lockfile-only reorders the @traceai/provider-media dependency entries alphabetically; commit that output so the lockfile check stays clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rder The attachment manager runs two upload workers, and the newer TS core queue on feat/attachments-ts-core finishes them in a different order, so uploads[63] can be part 62. Assert that exactly parts 0..63 were uploaded instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…viders Brings in the ts-core renewal fix and qualification fixes so the providers lane is tested against its current base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 5 tasks
…viders Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Migrate @traceai/provider-media from lazy `get data()` getters through manager.attach to the SDK design's preflight + ticket.attach (section 1, T-PF-09): - A gate preflight (adapter cap, or the known Blob/ArrayBuffer length) runs before any getter, URL string, byte array or base64 is read. Denied parts are never read. - After admission the source is sized from its shape, decoded, and attached; the reservation shrinks to the exact length. A gate denied only for size (too_large/queue_full come after every privacy, identity and sampling check), a part larger than the gate, or a data URI of another image type is preflighted once more at its exact type and length. - Unused admitted tickets are released at once. A manager without preflight captures nothing. Bedrock bytes keep no adapter cap beyond the manager's. - Consumed speech bodies are preflighted at read time with the exact size and source kind (Bytes or Blob). Tests: new test/preflight.test.cjs (P-01..P-09), and a sessionLimits option on the loopback fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts own reader SDK design 6.4 lets provider adapters observe a reader the application obtained. speechResponse now also wraps response.body.getReader(): each chunk the caller's read() resolves is forwarded to a consumed attachment stream (startAttachmentStream, 4 MiB reserved), finished when the caller reads to the end, and aborted on releaseLock, cancel, a read error, a tightened policy or the cap. The adapter never calls read, clone, tee or getReader itself. Consumers that never call the public getReader() and Node-stream bodies still upload nothing. One span is captured once whichever path reads it. Descriptor: audio.speech.create (openai, groq) adds source consumed_reader. Tests: new test/speech-stream.test.cjs (S-01..S-07); the media row for a reader read to its end now expects one upload. The workflow runs both new test files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
releaseLock() does not end a ReadableStream: the application can call getReader() again and read the remaining chunks. The second reader was also observed, so a read-release-reread sequence uploaded only the tail of the body as if it were complete (SDK design 6.3 forbids a truncated object). Only the first reader obtained on the body is observed now; later readers upload nothing. Test: S-08 (read two chunks, releaseLock, drain a second reader) expects no upload and an idle manager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…viders Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… adopt the clamped stream reservation - @traceai/provider-media exports ATTACHMENT_OWNER_KEY (Symbol.for "traceai.auto.attachment_owner.v1", the key the auto wire layer and the ElevenLabs instrumentation use), attachmentOwnedElsewhere(ctx) and ProviderMediaCapture#claim(ctx). A capture built with a parentContext that already carries the marker is inert: it never reaches the manager. - openai audio.* and groq audio.* run the SDK call in a claimed context, so wire-level capture skips the call and only the provider adapter uploads it. A locally hidden call is still claimed, so the hide holds for every layer. Groq chat is not claimed (chat media ownership is unchanged). - Consumed speech readers rely on the core's min(4 MiB, max_upload_bytes) reservation, so servers below 4 MiB now admit them; over-cap bodies are discarded whole. - Tests: owner.test.cjs (O-01..O-05), speech-stream S-09/S-10, and real OpenAI/Groq SDK rows that read the marker from the SDK's own fetch context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…viders Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lls only The latest OpenAI SDK makes one extra non-provider request through the custom fetch on a non-default base URL. The row now checks the audio call by route and that no request on that host carries the owner marker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… when it is built alongside With the openai/anthropic adapter in the same build (stacked lanes), a typed chat image is captured once by that adapter. The speech and owner rows now expect exactly that one upload, and still fail on a second copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With provider-media active, an OpenAI speech call is claimed for this layer, so the auto wire layer skips it. The speech body was observed only through arrayBuffer()/blob() and the public getReader(). `for await` and values() lock the stream with an internal reader, so an iterated body uploaded nothing, while auto alone uploads it once. Observe values() and [Symbol.asyncIterator] on the body instance through the same consumed-stream path as a reader: next() chunks are forwarded after the application's own promise fulfils, done finishes the stream, and return() (break), a rejected next(), a non-byte chunk or an over-cap body abort it so nothing partial uploads. Only the first reader or iterator on a body is observed. A locked body still throws the host error unchanged. Nothing is read eagerly. Tests S-11..S-17 cover for-await and values() to the end, break, preventCancel followed by a reader, the cap, a mid-iteration error, privacy modes and a locked body. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s only The async-iteration hooks also matched node-fetch 2 bodies (a Node PassThrough has [Symbol.asyncIterator]), so `for await` over an openai 4.x speech body on the default Node transport uploaded a copy, contrary to the documented contract and unlike the auto wire layer, which captures through fetch only. Chunk-wise observation is now gated on a WHATWG body (getReader present); whole-body arrayBuffer()/blob() reads are unchanged. Tests: S-18 (Node PassThrough body: no hook, end and break upload nothing) and an openai 4.x node-fetch shim row in the real-SDK suite (4.52.7 / 4.104.0; for await to the end and break upload 0; arrayBuffer() uploads 1 when enabled or hideInputs, 0 when disabled or piiRedaction). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uploads node-fetch 2 resolves blob() to its own Blob class rather than the global Blob, so provider-media does not observe that read. The openai 4.x node-fetch row now asserts it (0 uploads, no open stream), and the speechResponse docstring says so. Co-Authored-By: Claude Opus 5.5 <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.
Part of TH-2379 (Linear).
What this adds
A shared
@traceai/provider-mediahelper and thin bindings, so TypeScript provider packages can hand typed media (images, PDFs, audio) to the single attachment manager from the TypeScript attachment core (#677). Attachments stay off unless the application passes an enabled manager. Every privacy decision is made by the manager before any source bytes are read.Stacked on
feat/attachments-ts-core(#677).Supported operations (exactly these; see
PROVIDER_MEDIA_CAPABILITIES)@traceai/google-genai-sdkmodels.generateContent@traceai/google-genai-sdkmodels.generateContentStream@traceai/google-genaiGenerativeModel.generateContent@traceai/fi-instrumentation-vertexaiGenerativeModel.generateContent@traceai/bedrockConverseCommandon allowlisted Claude and Nova model idstoolResultblocks (tool screenshots)@traceai/groqFile/Blobaudio input; speech bytes the application itself reads (whole body, or its own reader to the end)@traceai/mistralchat.completeimageUrlchunks@traceai/portkey,@traceai/vllmchat.completions.createinput_audio@traceai/openaiExplicitly unsupported (fail closed, never captured)
Remote, signed or
gs:///s3://URLs, provider file ids, filesystem paths. Nothing is fetched or read.Gemini
generateContentStreamoutput, BedrockConverseStream, and completed-recording imports. Speech bodies consumed throughtee(),pipeTo(),pipeThrough()orclone(), and chunk-wise reads (for await,pipe,on('data')) of Node-stream bodies, such as the node-fetch 2 body that openai 4.x uses on its default Node transport. The auto wire layer uploads nothing for these either (it captures throughfetchonly, so on the node-fetch transport it uploads nothing for any read style).Async operations (submitted video/image jobs), Bedrock
InvokeModelbodies, unknown Bedrock model families,ConverseStream.Unknown or text-only hosts. Mistral 0.x clients, which are text-only.
The purposes and roles used (
model_input,model_output,tool_result; roletool) match the frozen contract'sPurposeandReference.roleenums.Privacy and lifetime
manager.preflight) before its source is read, sized or decoded, then attached with the ticket (ticket.attach). Disabled, hidden-input, hidden-image, PII-redaction and unsampled cases never touch the source (tests use throwing getters to prove this).traceConfigrestrictions are intersected with the manager policy; they can only deny.arrayBuffer()/blob(), reads a reader it got fromresponse.body.getReader()to the end, or iterates a WHATWGresponse.bodyto the end (for await,values()). On a node-fetch (Node-stream) body only a whole-bodyarrayBuffer()read is observed;blob()resolves node-fetch's ownBlobclass and is not. Unread, cancelled, partially read, released or broken-out-of bodies upload nothing, and the wrapper never clones, tees or reads the response itself.Package location and release entry (fix pass)
typescript/packages/provider-media, besidefi-core, not undertraceai_*. The@traceai/autoregistry test counts everytypescript/packages/traceai_*directory as an instrumentation, so the oldtraceai_provider_medialocation failed it (52 directories vs 51 registered integrations).release-please-config.jsonand.release-please-manifest.jsonhave an entry for it (release-type: node, componentnpm-traceai-provider-media,0.1.0). Without it,release_plan.py --checkand the release unit tests failed, andnpm_release.pywould refuse every release of the 9 dependent packages. Adding the entry publishes nothing.typescript/packages/provider-media/test/layout.test.cjsguards both: the directory must stay outsidetraceai_*, dependent tsconfig references must point at it, and the release-please config and manifest entry must matchpackage.json. It runs in the packagetestscript and as the first step of the provider-media workflow, so it runs on this stacked PR even though Release and the@traceai/autoworkflow only run againstdev/main.CI
TypeScript provider media attachmentsworkflow: helper unit tests, plus real provider SDKs at their floor and pinned latest versions against loopback servers inside a network namespace with no route out. A packed-helper consumer check, CJS and ESM.@traceai/openai,@traceai/google-genaior@traceai/google-genai-sdknow also stage the helper tarball, and dependent workflows trigger on helper changes.Not in this PR
@traceai/provider-media. Its release-please entry is in place (see the fix pass below); it has to be published before any dependent provider release, and that stays a release decision.OpenAIInstrumentation(Fireworks and similar) inherit chat capture. That waits for the OpenAI chat adapter to land.Qualification
Run on a temporary private cloud VM (Node 24.11.0 and 20.19.5). The package regression suites ran at
f896ae45; later commits changed only helper tests, the new workflow and the Groqinput_audiodialect gate, which CI re-qualifies. Synthetic data only. Provider SDK tests ran in a network namespace that had loopback only.hideInputs,hideInputMessages,hideInputImages,hideInputText,piiRedaction, wrapper-local hide/PII, unsampled), speecharrayBuffer/blob/unread/cancel/stream, late policy tightening, malformed and oversized base64, the data-URI part budget, Bedrock tool-result blocks and capability descriptors.openaigroq-sdk@google/genai@google/generative-ai@google-cloud/vertexai@aws-sdk/client-bedrock-runtime@mistralai/mistralaiportkey-ai@traceai/openai304 passed / 2 skipped,@traceai/groq141 passed / 5 skipped,@traceai/mistral31 jest + 79 native,@traceai/portkey322,@traceai/vllm22,@traceai/google-genai30,@traceai/fi-instrumentation-vertexai17,@traceai/bedrock8,@traceai/google-genai-sdksuite passed.@traceai/openaiin an npm consumer and in a non-hoisted pnpm consumer (strictImports); the standalone@traceai/google-genai-sdkbuild used by its compat workflow.f6b38013: all 12 checks green. The new provider-media workflow passed on Node 20 and 24: 28/28 helper tests, and 20/20 real-SDK tests for each of the floor and latest tiers. The 9 Google GenAI SDK packed-consumer jobs also passed.dev/main(OpenAI contracts, OpenAI gateway, Fireworks, legacy Gemini, Groq, Mistral, Portkey, vLLM). They run when this stack targetsdev. Of their packed-consumer steps, the OpenAI npm and non-hoisted pnpm consumers and the Google GenAI SDK standalone build were simulated on the VM. The legacy Gemini, Fireworks and gateway consumer steps were not simulated.Fix-pass qualification (head
08056560)Run on temporary private cloud VMs, Node 24.11.0, pnpm 10.30.1, from pristine trees: on
5b20ea51, and on a local merge of08056560with the currentfeat/attachments-ts-core(149fef0a), which is what PR CI tests. Every gate below passed on both. All three VMs were deleted and verified gone.uploads[63].part_indexfailed 3 out of 3 runs (62 !== 63). The manager runs two upload workers, and the new core queue changes their completion order. CI on5b20ea51hit the same failure. The test now checks that exactly parts 0..63 were uploaded, which is the budget it is meant to prove.f6b38013: the new layout test fails (exit 1) andrelease_plan.py --checkfails (exit 1).python3 -m unittest discover -s .github/release87 tests OK;release_plan.py --check"156 packages, versions and coverage consistent";npm_release.dependency_closureorders@traceai/provider-mediabefore each of its 9 dependents.pnpm install --frozen-lockfile, thenpnpm install --lockfile-onlyleavespnpm-lock.yamlunchanged;pnpm run build:orderedpasses.@traceai/auto: the registry test passes, and the wholetest/config.test.tspasses 12/12.testscript 30/30, helper unit tests 28/28 in a loopback-only network namespace, real SDKs 20/20 on the floor tier and 20/20 on latest. Packed helper installs into a clean npm consumer and loads as CJS and ESM. Notraceai_provider_mediareference remains.A pre-existing issue found along the way, outside this PR's scope:
@traceai/fi-instrumentation-vertexaikeeps process-wide patch state. A second copy of@google-cloud/vertexaiin the same process is never patched, so the SDK tests run each tier in its own process.Re-proof on head
7bddcd16(2026-11-11)Head
7bddcd16is08056560merged withfeat/attachments-ts-coref054a68e; it adds no provider changes. Run again on a temporary private cloud VM (Ubuntu 24.04, pnpm 10.30.1) from pristine clones, against the reviewed headf6b38013as the negative control. The VM was deleted and verified gone.7bddcd16f6b38013python3 -m unittest discover -s .github/release -p 'test_*.py'test_real_repo_has_complete_manifest_and_runtime_markers)release_plan.py --checktest_release_strategies.cjs(release-please@17.6.0) andbootstrap_audit.py --checktraceai_provider_mediareference left (git grep)pnpm install --frozen-lockfile, then--lockfile-onlyleaves the lockfile unchangedpnpm run build:ordered@traceai/autoregistry test /test/config.test.ts@traceai/autosuite, Node 22.23.4@traceai/provider-mediapackagetestscript7bddcd16: removing the release-please config entry fails the layout test andrelease_plan.py --check; pointingtraceai_groq/tsconfig.jsonback at../traceai_provider_mediafails the layout test; restoring them passes it again (2/2).test/bundle.test.tscases fail on both commits, because that Node prints animport-in-the-middle"hook has already been initialized" warning to stderr and the tests require empty stderr. This comes from the Node version, not from this PR. On Node 22.23.4, the version CI'ssetup-noderesolves22to, the full suite passes, as above.7bddcd16: every check is green, including a dispatched@traceai/autosuite run (44 suites, 1504 passed, Node 22.23.4). The Release workflow was not dispatched, because even its dry run plans releases for the whole repo from a feature branch. The cloud VM covered its plan-job gates (above), and Release runs for real once this stack targetsdev.Resync with the TypeScript attachment core
f0a56b37(head9accc54e)a286cd7dmergesfeat/attachments-ts-coref0a56b37(clean). On that merge, with no lane change, the old helper tests pass 30/30 and the real SDKs 20/20 per tier, so capture never stopped.db010c66moves the helper from lazyget data()getters throughmanager.attachtomanager.preflight+ticket.attach, as the SDK design requires (section 1):Blob/ArrayBufferlength.too_large/queue_fullcome after every privacy, identity and sampling check), a part larger than the gate, or a data URI of another image type. There are never more than two preflights per part.preflightcaptures nothing. Bedrock bytes have no adapter cap beyond the manager's.aca3eccaadopts the consumed-stream API (design 6.4) for speech output. When the application callsresponse.body.getReader(), each chunk its ownread()resolves goes tostartAttachmentStream(4 MiB reserved). The stream finishes when the application reads to the end. It aborts onreleaseLock,cancel, a read error, a tightened policy or the cap. One span uploads once, whichever path read it.9accc54eobserves only the first reader on a body.releaseLock()does not end a stream, so onaca3eccaa second reader uploaded only the tail of the body as if it were whole. A second reader now uploads nothing (row S-08). Descriptor change:audio.speech.create(openai, groq) adds sourceconsumed_reader.test/preflight.test.cjs(P-01..P-09) andtest/speech-stream.test.cjs(S-01..S-08). The provider-media workflow runs both. The media row for a reader read to its end now expects one upload.Qualified on a temporary private cloud VM (deleted and verified gone). It used the CI install and build commands, with tests in a loopback-only network namespace. The VM rebuilt all three trees from the public refs plus patches, and each tree matched the local commit.
FI_ATTACHMENTS_*warnings in any runreleaseLock/ drop chunks9accc54e(second VM, deleted): helper tests Node 20 / 24; real SDKs Node 24aca3eccabuildStill open(resolved in32e16cb1, see below): when the server'smax_upload_bytesis below 4 MiB, the reader path is deniedtoo_largeand captures nothing. The whole-body paths are unaffected, because they are preflighted at their exact size.Shared media-owner marker and the clamped stream reservation (head
8a1c8936)The auto module's wire layer and the ElevenLabs instrumentation already mark a call whose media they capture with the OpenTelemetry context key
Symbol.for("traceai.auto.attachment_owner.v1"). Before this change the provider-media speech path neither set nor read it, so auto plus@traceai/openaispeech could upload the same audio twice.68c3eedf/5044417amergefeat/attachments-ts-core(01b3327a, then930876ea). The changes are in fi-core only; this helper uses no deferred targets, sobind()returning false for a late bind does not affect it.32e16cb1,@traceai/provider-media:ATTACHMENT_OWNER_KEY(the sameSymbol.forkey;createContextKeyisSymbol.for, so no package imports another),attachmentOwnedElsewhere(ctx)andProviderMediaCapture#claim(ctx).parentContextthat already carries the marker never reaches the manager (no preflight, no stream, no upload); the application still gets every byte.openaiaudio.speech/transcriptions/translationsandgroqaudio calls run the SDK call in a claimed context, so wire-level capture skips them and only the provider adapter uploads. A locally hidden call is still claimed, so the integration's hide holds for every layer. Calls on unqualified hosts, calls with attachments off and Groq chat are not claimed.max_upload_bytes): this needs no helper code. The core (01b3327a) clamps the consumed-stream reservation to the negotiated single-upload cap. The reader path keeps asking for 4 MiB, now admits on servers below 4 MiB, and a body over the effective cap is discarded whole. Rows S-09/S-10 cover this.5012a6f9/8a1c8936: test-only.data:URL through the custom fetch. The unqualified-host row now asserts the provider call by route, and asserts that no request carries the marker.test/owner.test.cjs(O-01..O-05), S-09/S-10, and real OpenAI/Groq SDK rows. The SDK rows read the marker from the SDK's own fetch context, and an owned call uploads nothing.Qualified on a temporary private cloud VM, now deleted and verified gone. It used the CI install and build commands, with tests in a loopback-only network namespace. Each VM tree matched the local commit tree.
9accc54e+ core930876ea, no lane change)5012a6f9and8a1c8936)feat/attachments-ts-auto(9da7e9f0); the only conflict, intraceai_openai/src/instrumentation.ts, is resolved by keeping both sides. Real autopatchFetch+ wire observer and the real@traceai/openaiaudio wrapper; Node 22.23.4audio.speech) the speech rows and the first positive control return early, so floor exercises only transcription/translation, deny-wins, outer-owner and attachments-off. On latest, SpeecharrayBuffer, speech reader, and transcription/translationFileinput each upload exactly once, with or without an explicit auto capture policy, bound to the OpenAI audio span. Positive controls show auto alone captures. An outer ElevenLabs-style owner, a local hide, and attachments off upload nothingarrayBuffer, reader and transcription under an explicit auto capture policy upload two copies, and a local hide no longer stops auto's copy. Floor passes: openai 4.0.0 has no speech, and its multipart body is not a nativeFormData, so auto cannot see itThe cross-lane test needs auto's
src/wire/fetch, so it cannot live on this branch. It goes into the auto PR (or the integration branch) once this branch is merged there. GitHub CI on8a1c8936: 29/29 checks pass, including Provider media on Node 20 and 24 (owner, S-09/S-10 and SDK owner rows).Async iteration of the speech body (
018f3582)for awaitandvalues()lock the body with an internal reader, not the publicgetReader(), so an iterated speech body uploaded 0 copies. Auto alone uploads 1. This was found by the auto cross-lane proof.values()and[Symbol.asyncIterator]on the body instance now go through the same consumed-stream path as a reader:next()resolves is forwarded after its promise fulfils, anddonefinishes the stream;return()(abreak), a rejectednext(), a non-byte chunk, the cap or a tightened policy abort it, so nothing partial uploads;values({ preventCancel: true })followed by a reader uploads nothing;for awaitandvalues()to the end (one upload, andpulls() == 0after the iterator is obtained),break,preventCancelthen a reader, over the cap, an error mid-iteration, the four privacy modes, and a locked body.018f3582: 29/29. Provider media on Node 20 and 24 ran all 69 helper rows, including S-11..S-17, plus SDK 24/24 per tier.34809908" below.Node-stream bodies stay unobserved for chunk-wise reads (
afb4e5ae,34809908)018f3582: the iteration hooks matched any body with[Symbol.asyncIterator]. On openai 4.x's default Node transport the body is node-fetch 2'sPassThrough, which has one, sofor awaitover a speech body uploaded 1 copy, contrary to the documented contract and unlike the auto wire layer (0).getReaderpresent). Whole-body reads are unchanged.arrayBuffer(), auto 0 (it never sees the call) and provider-media 1;blob(), auto 0 and provider-media 0 (node-fetch's ownBlobclass is not the globalBlob).PassThroughbody gets no hook; iterating to the end or breaking uploads nothing). The real-SDK suite has a newopenai4tier (4.52.7 / 4.104.0) driving the SDK's own node-fetch against loopback. It asserts the body is a NodeReadable;for awaitto the end andbreakupload 0;arrayBuffer()uploads 1 when enabled orhideInputsand 0 when disabled orpiiRedaction;blob()uploads 0 in every mode.Cross-lane VM proof on
34809908Run on a temporary private cloud VM (Ubuntu 24.04, pnpm 10.30.1, lockfile unchanged), deleted and verified gone. Tests ran in a loopback-only network namespace.
93a2aa46merged with this head34809908and voicefd7ffc41. The only conflict was OpenAIinstrumentation.ts, resolved as the auto side plus thepatchSpeech/unpatchSpeechlines. Control C: the same merge with the old8a1c8936.@traceai/openai+ provider-media + ElevenLabs on one manager: 73/73 on X with openai 4.0.0 / 4.52.7 / 7.55.0 on Node 22 (4.0.0 has noaudio.speech, so the effective speech floor is 4.52.7), 4.52.7 and 7.55.0 on Node 20 and 24, and 7.55.0 three times. It covers every speech read style (arrayBuffer,blob, reader,for await,values,valueswithpreventCancel): exactly one upload per call, bound to the OpenAI audio span with provider-media active and to the wire span with auto alone.breakuploads 0, and privacy modes and a local hide upload 0. The node-fetch transport block (openai 4.52.7 and 4.104.0) givesfor await/break0,blob()0 andarrayBuffer()1 with provider-media.attachment-owner22/22.for await/values/valueswithpreventCancelwith provider-media active, each with and without a policy. Nothing else fails.return()not aborting: thebreakrow + S-12/S-13;for awaitrows + both S-18 rows;🤖 Generated with Claude Code