Repository navigation
Conversation
… attachment manager OpenAI chat/responses input images, files and computer_call_output screenshots, Responses image_generation_call and Images generate b64 outputs; Anthropic Messages image/document blocks and nested tool_result media with computer-tool screenshot classification. Decode is lazy behind manager admission, inline only and capped at 256 KiB per part. Telemetry payloads are projected so media bytes and filenames never reach OTLP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…telemetry otherwise Capture now runs before the telemetry projection and returns the admitted positions. Only those parts are replaced by their fi-attachment occurrence URI; denied, disabled or absent capture leaves the span payload exactly as before. A second observer of the same span position reuses the first occurrence. Streamed Responses output media and the Images edit and variation endpoints are explicitly unsupported. Adds a network-isolated CI workflow against real SDK floor and latest releases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dently of the manager Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r SDK typings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d data URIs The cloud mutation run showed the OpenAI cap was not exercised: the oversized case was not a data URI, so it failed the prefix check first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 5 tasks
…nai-anthropic Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Responses output Adopt the core preflight API (sdk-streaming-design section 1) in place of lazy `get data()` getters: - Each inline part is preflighted (deny-wins, budget reserved) before its value is read or decoded. Denied parts are never read. - An admitted ticket that is not used (malformed base64, MIME outside the allowlist, decode failure) is released at once, not left to the TTL sweep. - OpenAI data URIs naming a sibling MIME of the same modality are released and re-admitted under the exact MIME before decoding. - When the server negotiates an upload limit below the 256 KiB inline cap, preflight returns too_large only after every privacy step passed, so the part is re-preflighted with its exact decoded length. Small media keeps capturing as before. Streamed Responses: the generated image in the terminal response.completed event that the application consumed from its own iterator is now captured and projected out of the span output, before the span ends. Partial (preview) images and streamed images.generate stay unsupported and are named in the capability descriptor. Test fixtures mint one-hour sessions (core renewal window), assert no FI_ATTACHMENTS_* degradation warnings and no leaked tickets or bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ct size A cap-sized (256 KiB) preflight can return queue_full when the owned-byte budget is nearly used, where the previous attach() reserved only the actual length and admitted small media. queue_full, like too_large, is evaluated after every privacy, correlation and sampling step, so the part is sized exactly and preflighted once more. New test row for both providers. 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).
Summary
Wave B lane M02/M04: typed media capture for
@traceai/openaiand@traceai/anthropicthrough the sharedAttachmentManagerfrom@traceai/fi-core/attachments(stacked on #677).attachments: provider.attachments. With no manager, or a disabled one, span telemetry is unchanged.image_urlandfileparts;input_imageandinput_fileparts, pluscomputer_call_outputscreenshots (purposecomputer_screenshot, linked bycall_id);image_generation_calloutput, non-streamed, and streamed from the terminalresponse.completedevent the application consumed;images.generateb64_jsonoutput (a newOpenAI Imagesspan).imageanddocumentbase64 blocks, and one level oftool_resultcontent. Screenshots are classified only when a typedcomputer_YYYYMMDDtool and an assistanttool_usename it.manager.preflight(...)(deny-wins, budget reserved) before its value is read or decoded, then committed withticket.attach(...). Only inline data is supported, capped at 256 KiB per part. Base64 must be strict (alphabet, padding, round-trip). No URL or file fetching.fi-attachment:<occurrence_id>URI. Denied or not-captured parts keep today's payload. The request sent to the SDK is never mutated.captureOpenAIAttachments(manager, spanOrCorrelation, payload, {operation, direction, traceConfig?, capture?})andcaptureAnthropicAttachments(manager, spanOrCorrelation, payload, {traceConfig?, capture?}). Both return the admitted positions. Also exported:projectOpenAIMedia,projectAnthropicMedia, and frozen capability descriptors.Privacy
traceConfig(hideInputs/hideInputMessages/hideInputText,hideOutputs/...,piiRedaction,hideInputImages,hideErrorDetailsforis_errortool results) addscaptureContent:false, on top of the manager's own policy. So the core'sallowUnredactedMediaWithTextPiiopt-in cannot relax a local instrumentor'spiiRedaction. Python M01/M03 should match this.Explicitly unsupported (fails closed, named in the descriptors)
images.generate,images.editandimages.createVariation, and speech (lane M15).beta.messages.Behaviour notes
setAttributesthe same way.fi-attachment:URIs.Testing
typescript/packages/traceai_openai/test/attachments-providers.test.cjsruns real SDKs against loopback provider and attachment-API mocks. It covers:asResponse()callers;openai-anthropic-attachments-tests.ymlruns it network-isolated for OpenAI 4.0.0, 5.23.2, 6.0.0, 7.47.0 and latest, paired with Anthropic 0.20.0, 0.27.3, 0.133.0, 0.134.0 and latest. It also runs both packages' jest suites.OpenAI SDK contractsandAnthropic TypeScript testsworkflows were dispatched on this branch, because theirpull_requesttrigger only fires fordev/mainbases.OVERALL_FAIL=0.currentSdk(json and proto+gzip, manual), recall/privacy regressions andapiPromisepass for 4.0.0, 7.47.0 and latest.native-boundary,release-lifecycle(normal and privacy) and README pass for all 5 pinned SDKs.hideInputImages(both packages);hideErrorDetailserror-detail flag;2026-11-11: resync with the updated core (#677 at f0a56b3)
feat/attachments-ts-core(f0a56b3) into this branch (merge, no rebase). The merge was clean, and the unchanged lane already passed 44/44 on it, so capture kept working.get data()getters:image/jpegafter animage/pngpreflight) is released and re-admitted under its exact MIME before decoding;too_large), or the owned-byte budget is nearly used (queue_full), the part is re-preflighted once with its exact decoded length. Preflight reaches either answer only after every privacy, correlation and sampling step has passed. So small media keeps capturing exactly where the oldattach(), which reserved only the actual length, captured it.response.completedevent is captured and projected out of the span output before the span ends. This uses the iterator the application already consumes, with no extra reads, clones or tees. It is a complete base64 value, so it goes through preflight and attach, not the byte-stream API. Partial images stay unsupported.responses.stream.outputadded tooperations.streamed_outputwas removed fromunsupported, andimages.generate.streamwas added.FI_ATTACHMENTS_*degradation warning and no leaked tickets or bytes. New rows cover a negotiated limit, a nearly used budget, and a sibling MIME.queue_fullretry) it fails exactly the two nearly-used-budget rows.too_largeonly fails the 2 budget rows;Not in this PR
🤖 Generated with Claude Code