Repository navigation
Conversation
traceai.init passes ONE attachment manager to every instrumentor it enables, as attachments=. It is the provider's manager, or one the application lends with attachment_manager= (never shut down by traceai; it only gains the hide and PII flags of trace_config). With attachments OFF, or killed by FI_ATTACHMENTS_ENABLED=false, instrumentors receive exactly the keyword arguments they received before. New public helpers: get_attachment_manager(), report() (attachment state and per-integration media support: provider_adapter, session_binding or unqualified, version aware), with_attachment_capture_policy() and with_attachment_ownership(). The shared provider-media helper reads the two context keys by name: a per-call CapturePolicy can only add restrictions, and an owner mark turns capture off for that call. The fi-instrumentation-otel floor is unchanged; attachments stay import-guarded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed manager Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…edia Shared helper fi_instrumentation.attachments.tool_media on the public manager API and media_capture: tool media is tool output and model input, so both directional hide flags and PII redaction deny; preflight before any read or decode; bounded budgets; per-manager dedup; owner-key honoured. - traceai_mcp: wrap_mcp_client() / capture_mcp_result() for typed image, audio and inline resource blobs (never resource URIs or links). - traceai_mcp_use: FutureAGICallback captures typed tool blocks. - traceai_openai_agents: computer screenshots and typed tool images/files on the function span, projected to fi-attachment URIs. - traceai_claude_agent_sdk: tool_result image/PDF blocks before truncation, on the tool span (live or its exact ended context). - traceai_smolagents: in-memory model-input and tool images. - traceai_firecrawl: inline data-URI screenshots and media only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… key The Python auto module and the shared media helper stored the per-call capture policy under "traceai.auto.attachment_capture_policy.v1", while the TypeScript auto module uses "traceai.auto.attachment_policy.v1". Use the TS name in both places so the two languages share one key name, as the owner key already did. Tests pin both names to the TS strings and prove a policy set by name alone restricts capture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nts-python-auto Brings in the MCP, agent SDK, smolagents and Firecrawl media adapters (#693) so the auto module can register them and report their capability descriptors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…odule traceai.init now enables openai_agents, claude_agent_sdk, smolagents and firecrawl by name and hands them the one shared attachment manager, with the same OFF keyword arguments as every other instrumentor when attachments are off. report() reads each installed package's capability descriptor for those four plus mcp and mcp_use, so a package version without the adapter stays unqualified. mcp_use has a LangChain callback, not an instrumentor: enabling it only records it, and traceai.mcp_use_callback() builds the callback on auto's provider, hide flags and shared manager. traceai.wrap_mcp_client(session) does the same for MCP, whose instrumentor only propagates context. Both pass the manager only while capture is on and the installed package has the adapter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eds mcp<2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… deny mislabelled media Claude Agent SDK: the CLI usually runs PostToolUse before it streams the tool result. The hook ended the tool span first, so tool-result media was uploaded against an ended span context and no span carried its fi.attachment.refs. With attachments on, the hook now defers the span's end until its ToolResultBlock has been captured (bounded table, 30 s timer, conversation end and disconnect flush), then ends it at the time the hook recorded. Results with no traced tool go to the live conversation span. With attachments off the hook ends the span immediately, as before. tool_media: bytes whose leading signature names another modality than the declared MIME (a PNG labelled audio/wav or application/octet-stream) are denied, so a mislabel cannot escape hide_input_images. OWNER_KEY aliases the core constant when the core defines it. smolagents: every model call that carries a captured image, new or replayed, is marked as owner, so a provider adapter never re-uploads a replayed image. The seen-image table gets a fresh lock in a forked child (pid check, no fork hook). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k media adapters - _MEDIA_ADAPTERS gains google_genai, vertexai, bedrock, litellm, fireworks, xai, mistralai, openrouter, portkey, ollama, vllm and minimax (lazy descriptors from provider_media), plus langchain, llamaindex, agno and pydantic_ai. together, deepseek and cerebras stay unclaimed, and a descriptor with no operation is reported unqualified. - auto_instrument accepts openrouter, portkey, vllm, minimax, pydantic_ai and agno. Agno gets its own keyword arguments: no fi TraceConfig or attachment_* alias, auto's hide flags as an OpenInference TraceConfig, attachments only while capturing. - An instrumentor that skipped instrumentation on a dependency conflict is reported dependency_unavailable instead of registered. - Real-SDK tests: report rows equal each installed descriptor; LiteLLM over the OpenAI instrumentor uploads once through auto; OFF never reaches F01; Agno and Pydantic AI through auto. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…installed A traceai-agno release before the adapter has no `attachments` parameter, so auto with attachments on raised TypeError there and left Agno untraced. Auto now passes `attachments` only while capturing AND when the installed package declares its descriptor; otherwise Agno gets the OFF arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gate, image signatures - Claude Agent SDK: a completed tool span waits for its result only while that client's receive_response() conversation is live; receive_messages() and hooks that run before receive_response() end the span at the hook, as before. - Deferral tables and results-seen are per client (ToolDeferrals); a conversation end or disconnect() flushes only that client's waiting spans. - tool_media: BMP, TIFF and ISO-BMFF HEIF/AVIF image brands join the signature table, so those images cannot escape hide_input_images under an audio, video or octet-stream label. Octet-stream blobs with a recognised signature are skipped (documented). - Tests: receive_messages() without disconnect(), two concurrent clients, mislabelled BMP/TIFF/HEIF rows and the octet-stream rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cannot apply Agno's privacy bridge reads pii_redaction and hide_error_details only from FI_PII_REDACTION / FI_HIDE_ERROR_DETAILS. When auto's trace_config sets either one in code and the environment (plus the forwarded hide flags) would not, auto no longer passes attachments= to Agno and reports the row config_unsupported. OFF arguments are unchanged. README lists the provider and framework rows, including vllm and minimax. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nsupported rows LangChain and Agno over the OpenAI instrumentor through traceai.init upload each call's image once, on the framework span (both enable orders). Agno with pii_redaction or hide_error_details set only in code is config_unsupported and uploads nothing; the same flag from the environment keeps its media; with the OpenAI instrumentor also on, the unmarked call is owned by the OpenAI span. 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 does
traceai.init(the Python auto module) now hands one attachment manager to every instrumentor it enables, asattachments=. This mirrors@traceai/auto(#687) where Python allows it. Python has no HTTP wire layer, so the TS wire capture (A03/A04) has no Python counterpart.init(attachment_manager=...). The instrumentors also receive it asattachment_manager=, the alias feat(python): OpenAI, Anthropic and Groq attachments (images, files, computer-use screenshots, speech) #690 accepts.get_attachment_manager()returns that manager, orNonebeforeinit().trace_confighide and PII flags to it and never removes a flag that is already set. Auto never shuts a borrowed manager down. When borrowing, the provider is built with attachments disabled, soFI_ATTACHMENTS_ENABLED=truecannot start a second manager.attachment_managerandattachment_configcannot be passed together.FI_ATTACHMENTS_ENABLED=falseat init, instrumentors get the OFF arguments. If it is set after init, the core already denies every admission, andreport()/attachment_status()now showdisabled; a running manager's ownstatus()does not consult the variable. A borrowed manager is not disabled permanently.with_attachment_capture_policy(policy, context=None)adds aCapturePolicyrestriction. It is intersected deny-wins with any policy already in the context; anything that is not aCapturePolicydenies.with_attachment_ownership(context=None)marks calls whose media your own adapter captures, so instrumentors upload nothing for them.traceai.auto.attachment_policy.v1,traceai.auto.attachment_owner.v1), the same strings as the TypeScripttraceai_autokeys. Because the keys are plain strings, no package has to import another; code inside this repo should still usemedia_capture.CAPTURE_POLICY_KEY/OWNER_KEYrather than repeat the literals.report()gives a content-free view:attachments: state, queue counters,borrowed, sources, and what is unsupported.integrations[]: one row per instrumentor package, withstatusandmedia.mediaisprovider_adapteronly when the installed instrumentor exposes its capability descriptor: for exampletraceai_openai,traceai_anthropic(rows also listmedia_operations, for exampletool_result.input) andtraceai_groq; the full list is in the sections below. It issession_bindingfor Pipecat/LiveKit when the installed package has thebind_*entry point, andunqualifiedotherwise.Cross-lane touch (shared helper from #690)
fi_instrumentation/attachments/media_capture.pygains a small, additive reader for the two context keys:local_capture_policyfolds the context policy in deny-only, and an owner mark setsrequested=False.Observationis unusable under an owner mark.merge_capture_policies,context_capture_policy,owned_elsewhere,CAPTURE_POLICY_KEYandOWNER_KEY.All three Python provider adapters (OpenAI, Anthropic, Groq) go through this helper, so they honour both helpers with no adapter edits.
With attachments OFF, nothing changes
When the manager is the disabled null object (or killed by the environment variable),
instrument()receives exactly the keyword arguments it received before:tracer_provider,config,attachment_manager,attachment_policy. The existing unit test that pins them is unchanged. VM proof: the same OFF probe on base and head exports identical spans and provider requests, starts nofi-thread, and registers the same fork hooks as base, none of them from attachments (see Testing).MCP and agent media adapters (merged from #693)
This branch includes #693 (
feat/attachments-python-mcp-agents) by merge, now at4901f03d(per-client Claude tool-span deferral, the live-conversation gate and more image signatures; merged clean in50370aa4). #693's MCP/agent workflow also runs on this PR.auto_instrumentacceptsopenai_agents/openai-agents,claude_agent_sdk/claude-agent-sdk,smolagentsandfirecrawl. Each one gets an explicit entry point (OpenAIAgentsInstrumentor,ClaudeAgentInstrumentor,SmolagentsInstrumentor,FirecrawlInstrumentor) and the same keyword arguments as every other instrumentor: the shared manager when capture is on, and exactly the OFF arguments when it is off. Nothing new is enabled unless it is named.mcp_use/mcp-use. mcp-use has a LangChain callback, not an instrumentor, so enabling it only records it (like Pipecat and LiveKit).traceai.mcp_use_callback(**kwargs)returns aFutureAGICallbackthat uses auto's provider andtrace_confighide/PII flags.traceai.wrap_mcp_client(session, **kwargs). This is the MCP entry point that captures media; the MCP instrumentor only propagates context. An installedtraceAI-mcpwithoutwrap_mcp_clientgets the session back unchanged, and the row reportsunsupported_version.attachments=only while capture is on and the installed package has the adapter. Otherwise they make the call they made before. Caller keyword arguments always win.report()._MEDIA_ADAPTERShas the six descriptors:mcp_attachment_capabilities,mcp_use_attachment_capabilities,openai_agents_attachment_capabilities,claude_agent_attachment_capabilities,smolagents_attachment_capabilitiesandfirecrawl_attachment_capabilities. A row isprovider_adapterwith that package'smedia_operationsonly when the installed version has the descriptor; otherwise it isunqualified. This is TS parity: the name is in the adapter set. Formcpandmcp_use, the row describes the explicit entry point above, not auto on its own.Provider and framework media adapters in auto (
c53acf38)This makes auto's registry and
report()cover the adapters from #697 (provider media) and #691 (framework media). Neither PR is merged here. Each descriptor is looked up lazily, from the installed package, whenreport()runs. So on this branch alone, every new row reportsunqualified, and it becomesprovider_adapteronce the package version that has the adapter is installed. The latest VM proof ran on a merge tree of this head + #69711e6b916+ #69166c43710(see Testing)._MEDIA_ADAPTERSadds:traceai_<pkg>→<pkg>_attachment_capabilitiesfor google_genai, vertexai, bedrock, litellm, fireworks, xai, mistralai, openrouter, portkey, ollama, vllm and minimax (groq keeps its_audiodescriptor);langchain,llamaindex,agnoandpydantic_aithrough their_attachmentsmodules.together, deepseek and cerebras claim no media operation and are deliberately left out, so their rows stay
unqualified. A descriptor whoseoperationsis empty is now reportedunqualified, neverprovider_adapter.Fail-closed lookup. Each row is
unqualifiedwhen:AttributeError);provider_media(ImportError);Registry.
auto_instrumentaccepts:openrouter,portkey,vllmandminimax;pydantic_ai/pydantic-ai(PydanticAIInstrumentor, generic keyword arguments);agno(AgnoInstrumentorWrapper).Agno has its own keyword arguments. Its wrapper takes OpenInference's
TraceConfigand noattachment_*alias, so the generic arguments would raiseTypeError. Auto passes:tracer_provider;attachments=the shared manager, only while capturing AND only when the installedtraceai-agnodeclares its media descriptor. A release before the adapter has noattachmentsparameter; it gets the OFF arguments and keeps tracing (dd79fcfa);config=an OpenInferenceTraceConfigcarrying auto'shide_*flags, only when one is set. Without a flag, Agno keeps its own defaults and environment policy.With attachments OFF, Agno gets exactly
tracer_provider=, plusconfig=when a hide flag is set. That is whatconfigure_agno_tracing(tracer_provider=..., config=...)gets.Agno fails closed on flags it cannot apply (
2010273d). Agno's privacy bridge builds its FI config from the environment and takes only thehide_*flags from the OpenInference config. It has no hook forpii_redactionorhide_error_details; it reads them only fromFI_PII_REDACTIONandFI_HIDE_ERROR_DETAILS. So when auto'strace_configsets either flag in code, and Agno would not get it from the environment plus the forwarded hide flags (they also derivehide_error_details):attachments=to Agno, so Agno captures no media;statusisconfig_unsupported(inreport()andattachment_status()), with a warning whenverbose;attachments=is dropped); OFF arguments are unchanged.traceai_openai(which does apply the flag) owns that call's media: one upload, on the OpenAI span.Accurate status on a dependency conflict.
BaseInstrumentor.instrument()returns without instrumenting when its requirement check fails. For example,PydanticAIInstrumentorrequires thepydantic-aidistribution, andpydantic-ai-slimalone fails that check. Auto now reports such an instrumentor asdependency_unavailable, notregistered.Owner rule (unchanged, now proven through auto). LiteLLM over the OpenAI instrumentor, both enabled by
traceai.init, uploads the call's image once, on the LiteLLM span. The OpenAI span for the nested SDK call has no refs.Merged feat(python): MCP, agent SDK, smolagents and Firecrawl tool media (attachments C01/C03/C05/C06) #693 again at
92939ee9, and again at4901f03d. The six MCP/agent descriptors are unchanged.report()rows for vLLM and MiniMax. Both have been in_MEDIA_ADAPTERS, the registry and the entry points sincec53acf38; the README now lists every row that can beprovider_adapter(providers, frameworks, MCP/agents).Known limits:
report()imports each installed instrumentor package to read its descriptor.traceai_litellmandtraceai_portkeyimport their SDKs at module level. SetLITELLM_LOCAL_MODEL_COST_MAP=Trueto keep LiteLLM's import offline.hide_*flags, but not a programmaticpii_redaction=Trueorhide_error_details=True(seeconfig_unsupportedabove).media_capture.py. Keep both paragraphs (owner mark, then per-span occurrence).Unchanged on purpose
fi-instrumentation-otel >=0.1.7floor. The attachment import stays guarded. On a core without attachments,report()saysunsupported_version, every row isunqualified, andattachment_manager=raises a clear error (subprocess test)._bindand the voicebind_*helpers. They read the provider's manager, which is now also the borrowed one. Thetraceai/__init__.pychanges in feat(python): Pipecat recorder, LiveKit owned-file and Egress import on the shared attachment core #678 (voice) touch other lines; merging the two is left to reconciliation.Testing
67e5cbc0(#6934901f03d, Agnoconfig_unsupported, auto framework+OpenAI rows).pii_redactionorhide_error_detailsgives noattachments=andconfig_unsupported; the same flag from the environment keepsattachments=andregistered;hide_inputsalone (which deriveshide_error_details) staysregistered; OFF arguments stay exactlytracer_provider=.test_auto_framework_media.py(they skip on feat(python): one shared attachment manager in the auto module (traceai) #692 alone, and run on a tree with feat(python): framework media capture, one owner per model call (LangChain, LlamaIndex, Agno, Pydantic AI) #691 and feat(python): provider media for Gemini, Vertex, Bedrock, LiteLLM and compatible chat #697): LangChain over OpenAI and Agno over OpenAI throughtraceai.init, in both enable orders, upload once, on the framework span; Agno with either flag only in code uploads nothing and reportsconfig_unsupported; the environment control keeps its media; Agno + OpenAI withhide_error_detailsin code gives one upload, on the OpenAI span.67e5cbc0: 30/30 pass.Attachments Python 3.12has 470 passed (467 before; the 3 new unit tests ran).Provider attachments (latest)has 72 passed and 20 skipped (the 9 new framework rows skip here, as designed).11e6b916+ feat(python): framework media capture, one owner per model call (LangChain, LlamaIndex, Agno, Pydantic AI) #69166c43710(merges only, clean on top of the earlier docstring resolution). OFF baseline BM =dd79fcfa+ the same two merges.tests/attachments+traceai/tests): 470 passed on floor (3.10) and latest (3.12).report()row.pydantic-ai-slimalone fails auto's dependency check, as before). All 9 rows that skip on this branch alone now ran and passed:pii_redactionorhide_error_detailsonly in code: no upload,config_unsupported;hide_error_detailsin code with OpenAI on: one upload, on the OpenAI span.langchain-openai, which is latest-only.report()on M, latest, withhide_error_detailsin code: agnoconfig_unsupported/provider_adapter; langchain and openairegistered/provider_adapter; vllm and minimaxnot_installed/unqualified(not installed in that venv).pii_redactionin code.fi-threads (none) and fork hooks are identical.agno.agent.id,graph.node.id, acreated_atepoch), which also differ between two BM runs. With those masked they are identical.pii_redactionin code, the Agno row reportsconfig_unsupportedinstead ofregistered.registered; bare baseline; environment ignored, unit and real; LiteLLM owner claim). Unmutated controls pass.dd79fcfa(Agno gate). VM, same setup:tests/attachments+traceai/tests: 467 passed.traceai-agno(no adapter) withagno==3.1.12and attachments ON: Agno is instrumented and the row isregistered.c53acf38behaviour on the same install left Agno uninstrumented (unsupported_version), which reproduces the bug this commit fixes.CI on
dd79fcfa: 30/30 checks pass.c53acf38(provider and framework media rows). All runs were on a private GCP VM, loopback only, with outbound network off for every test. There were four trees:2e6778dd, this head without the change;774675b9+ feat(python): framework media capture, one owner per model call (LangChain, LlamaIndex, Agno, Pydantic AI) #69180693890;2e6778dd.The only conflict was the #691 docstring in
media_capture.py, resolved by keeping both paragraphs. M was never pushed.tests/attachments+traceai/tests, py3.10 / 3.12tests/attachments_providers, floor / latest (openai/anthropic/groq CI pins)TRACEAI_EXPECT_PROVIDER_ADAPTERS=1plus the expected row nameprovider_media.capabilities); together, deepseek, cerebras rows areunqualifiedtraceai.init, litellm 1.53.1 + openai 1.69.0 / litellm 1.109.1completionspan, the nested OpenAI span has none, in both enable orders. Control: OpenAI alone captures the same call once. OFF and kill switch: F01 never contactedunqualified(no descriptor →AttributeError); openai staysprovider_adapterprovider_media)ModuleNotFoundError; rowsunqualifiedtrace_config=TraceConfig(hide_inputs=True)keeps both the prompt text and the image outpydantic-ai-slimonly: rowdependency_unavailable, nothing traced. Withpydantic-ai==2.67.0: image uploaded once; OFF: no F01 requestOFF invariant. The probe ran with attachments OFF, auto-instrumented, against a loopback provider, with real calls from openai + litellm (floor and latest), groq, ollama and bedrock. M and its base export identical spans, provider requests,
fi-threads (none) and fork hooks. Two base runs were also identical to each other, so the probe has no run-to-run noise. In both trees the probe's google-genai call raisedRuntimeErrorand its mistralai import raisedImportError, the same way on both sides; those two rows prove nothing. For the six newly registered names there is no base to compare against. For openrouter, portkey, vllm and minimax, auto with attachments OFF matched calling<Instrumentor>().instrument(tracer_provider=...)directly, once object addresses in the<openai.Omit object at 0x…>reprs were normalised. The vLLM and MiniMax client checks were opened in both modes, as #697's tests do. Agno and Pydantic AI OFF behaviour is covered by the rows above.Mutations (control: 37 unit tests and the LiteLLM rows pass). Each of these 11 made named tests fail:
_MEDIA_ADAPTERS;attachments=passed to Agno while OFF;pydantic_airegistry entry removed;CI on
c53acf38: 30/30 checks pass.Not covered: through auto, the vLLM instrumentor traces only
localhost:8000(its defaultvllm_base_urls), and MiniMax traces only MiniMax hosts. auto cannot passvllm_base_urls.a598b9ad(MCP/agent adapters). All runs were on a private GCP VM, loopback only, with outbound network off for the all-six suite. The VM tested42724ea6;a598b9adchanges only the CI pin (mcp<2, becausemcp-use==1.7.1needs it), and the VM used the same pin.0b2eb4b5tests/attachments_providers, floor / latesttests/attachments+traceai/tests, both tierstest_auto_registry.py, all six packages installed (mcp 1.30.0,mcp-use 1.7.1,openai-agents 0.24.0,claude-agent-sdk 0.2.180,smolagents 1.26.0,firecrawl-py 4.55.0,openai 3.49.0)The openai-agents latest package suite has one collection error (
InputTokensDetailsvalidation with openai 3.x). It reproduces on #693's base and is not caused by this PR.test_auto_registry.pyrunstraceai.initagainst the real packages:traceai.wrap_mcp_clienton a real stdio MCP session uploads the tool screenshot through the shared manager, and with attachments OFF uploads nothing and leaves the SDK result unchanged;traceai.mcp_use_callback()on a realMCPAgentuploads the tool image, and uploads nothing underhide_outputs;In CI,
TRACEAI_EXPECT_MCP_AGENT_ADAPTERS=1turns a missing package into a failure, so a broken install cannot pass by skipping.OFF invariant: with attachments OFF, the probe's exported span attributes and provider requests are identical to
0b2eb4b5on both tiers.Mutations (control: 62 passed,
traceai/tests+test_auto_registry.py). Each of these 10 made named tests fail:firecrawlregistry key dropped (6 tests fail);wrap_mcp_clientcrashes on an oldtraceAI-mcp.CI on
a598b9ad: 30/30 checks pass, including the newauto attachments (latest)row.0b2eb4b5and earlier, same VM setup:All runs were on a private GCP VM, loopback only. Real SDKs ran against a local fake provider and a TLS loopback F01 server. Floor tier: Python 3.10,
openai==1.69.0,anthropic==0.41.0,groq==0.9.0. Latest tier: Python 3.12,openai==3.49.0,anthropic==2.8.0,groq==1.7.0. Base isf5e77e08, compared on the same VM.f5e77e08dc69e5100b2eb4b5(key rename)tests/attachments_providers, floortests/attachments_providers, latesttests/attachments+traceai/tests, both tiersThe single openai package failure on base and
dc69e510(test_parallel_readme_responses_snippet) is a harness artefact: it readspython/frameworks/parallel/README.md, which those trimmed source tarballs left out. The0b2eb4b5run used the full tree, and the test passes there.0b2eb4b5, per-call policy key renamed to the TypeScript name.media_capture.CAPTURE_POLICY_KEYandtraceai._CAPTURE_POLICY_KEYare now"traceai.auto.attachment_policy.v1". Two new tests pin both keys to the TS strings and prove that a policy set under the name alone restricts capture. With attachments OFF, the probe's exported spans and provider requests are identical todc69e510on both tiers. Key mutations (control: 107 passed): restoring the old name in the helper only, in auto only, or in both (the original bug) each fails 5, 5 and 2 named tests. The 11 mutations below were re-run on0b2eb4b5(control 107 passed) and all 11 were still detected.New end-to-end tests (
tests/attachments_providers/test_auto_init.py):traceai.init(attachment_config=enabled, auto_instrument=["openai", "anthropic"])captures an OpenAI chat image and an Anthropic computer-use screenshot, end to end to F01. The screenshot keepstool_call_idand its message position (computer_screenshot, roletool). The exported spans carry no base64.report()showsreadyandprovider_adapterfor both integrations, with no credentials or endpoint in it.redaction_unavailable). Auto does not shut it down.report()saysdisabled, and capture resumes when the variable is unset. Kill switch at init: the old code path runs and there is not even a session bootstrap.capture_content=Falseormutedpolicy, or an owner mark, uploads nothing. A permissive per-call policy still captures.OFF invariant. The same probe ran on base and on this PR, with attachments OFF, a real OpenAI image call and a real Anthropic computer-use call. Exported span attributes and provider requests were byte-identical on both tiers. No
fi-thread started. The fork hooks registered were the same as on base: oneafter_in_childhook from the OpenTelemetry SDKTracerProvider, and none from attachments.Mutations: the control run passed 105 tests on
dc69e510(107 on0b2eb4b5) (providers suite andtraceai/tests, latest tier). Each of these 11 mutations made at least one named test fail:attachments=kwarg dropped: the OpenAI and Anthropic end-to-end tests and 4 others fail;report()ignoring the kill switch;report()media rows that are not version aware;Observation.🤖 Generated with Claude Code