Skip to content

fix: Disable image uploader for non-tl endpoints - #19

Merged
manas-fortifyroot merged 1 commit into
fr-v0.52.6.xfrom
fix/disable-image-uploader-non-tl
Apr 10, 2026
Merged

fix: Disable image uploader for non-tl endpoints#19
manas-fortifyroot merged 1 commit into
fr-v0.52.6.xfrom
fix/disable-image-uploader-non-tl

Conversation

@manas-fortifyroot

Copy link
Copy Markdown

Summary

  • When the SDK is configured with a non-Traceloop endpoint, the ImageUploader was still
    instantiated and passed to instrumentors. This caused KeyError: 'url' exceptions in
    background threads when processing vision/image content, because the target endpoint
    doesn't serve the Traceloop-specific /v2/traces/.../images API.
  • The Config.upload_base64_image class attribute in openai, google-generativeai, and
    vertexai instrumentors had a default lambda (lambda ...: str) that was truthy, bypassing
    the if not Config.upload_base64_image guard. Changed to None.

Changes

  • traceloop-sdk/__init__.py — Only create ImageUploader when endpoint_is_traceloop
  • traceloop-sdk/tracing/tracing.py — Guard image_uploader.aupload_base64_image against None
  • openai/shared/config.pyupload_base64_image default: lambda → None
  • google_generativeai/config.py — same
  • vertexai/config.py — same
  • anthropic/config.py — already None, no change needed

Test plan

  • run-tests.sh --all — 1278 passed, 0 failed across 31 packages
  • traceloop-sdk: 194 passed (previously 40 errors from AttributeError: NoneType has no aupload_base64_image)
  • openai: 259 passed
  • google-generativeai: 32 passed
  • anthropic: 101 passed

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)
@manas-fortifyroot
manas-fortifyroot merged commit 0c667b8 into fr-v0.52.6.x Apr 10, 2026
9 checks passed
@manas-fortifyroot
manas-fortifyroot deleted the fix/disable-image-uploader-non-tl branch April 10, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant