fix: Disable image uploader for non-tl endpoints - #19
Merged
manas-fortifyroot merged 1 commit intoApr 10, 2026
Conversation
The ImageUploader was always instantiated regardless of whether the endpoint is a Traceloop cloud endpoint. For non-Traceloop endpoints, the /v2/traces/.../images API doesn't exist, causing KeyError in a background thread during vision/image content processing. - Only create ImageUploader when endpoint_is_traceloop=True - Guard against None image_uploader in init_instrumentations - Change Config.upload_base64_image default from truthy lambda to None in openai, google-generativeai, and vertexai instrumentors (anthropic already had None default)
Merged
4 tasks
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
ImageUploaderwas stillinstantiated and passed to instrumentors. This caused
KeyError: 'url'exceptions inbackground threads when processing vision/image content, because the target endpoint
doesn't serve the Traceloop-specific
/v2/traces/.../imagesAPI.Config.upload_base64_imageclass attribute in openai, google-generativeai, andvertexai instrumentors had a default lambda (
lambda ...: str) that was truthy, bypassingthe
if not Config.upload_base64_imageguard. Changed toNone.Changes
traceloop-sdk/__init__.py— Only createImageUploaderwhenendpoint_is_tracelooptraceloop-sdk/tracing/tracing.py— Guardimage_uploader.aupload_base64_imageagainst Noneopenai/shared/config.py—upload_base64_imagedefault: lambda →Nonegoogle_generativeai/config.py— samevertexai/config.py— sameanthropic/config.py— alreadyNone, no change neededTest plan
run-tests.sh --all— 1278 passed, 0 failed across 31 packagesAttributeError: NoneType has no aupload_base64_image)