Skip to content

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64 - #43322

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:fix/langfuse-redact-base64-data-uri
Jun 10, 2026
Merged

kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:fix/langfuse-redact-base64-data-uri

Conversation

@kshitijk4poor

Copy link
Copy Markdown

Summary

Redact base64 data: URIs in the Langfuse plugin instead of truncating them into invalid base64 payloads.

The Langfuse SDK treats data:*;base64,... strings as media and attempts to decode them. _truncate_text was slicing those strings mid-payload, producing invalid base64 and noisy Error parsing base64 data URI logs. Observability only needs the metadata (type, media type, length), not the raw image/audio bytes — so the whole data URI is redacted before it reaches the SDK.

Context

This is a single-concern salvage of one part of #39682, lifted onto current main. The other concerns in that PR are already resolved upstream:

The skill_view frontmatter-name fix from #39682 is sent separately.

Test Plan

venv/bin/python -m pytest tests/plugins/test_langfuse_plugin.py -q
  • 41 passed (adds TestPayloadSanitization: base64 data URI is redacted to {type, media_type, omitted, length} instead of truncated, both as a bare value and inside image_url message parts).
  • ruff check clean on touched files.

Co-authored-by: foras910521-lab foras910521-lab@users.noreply.github.com

…alid base64

The Langfuse SDK treats `data:*;base64,...` strings as media and tries to
decode them. `_truncate_text` was slicing those strings mid-payload, producing
invalid base64 and noisy "Error parsing base64 data URI" logs. Observability
only needs the metadata, not raw image/audio bytes, so redact the whole data
URI (type, media_type, length) before it reaches the SDK.

Salvaged the Langfuse fix from NousResearch#39682 onto current main as a standalone,
single-concern change (the dashboard `dist/**` and plugin-discovery parts of
that PR already landed separately on main).

Co-authored-by: foras910521-lab <foras910521-lab@users.noreply.github.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have labels Jun 10, 2026
@kshitijk4poor
kshitijk4poor merged commit f1b8519 into NousResearch:main Jun 10, 2026
20 checks passed
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
…64-data-uri

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
…-redact-base64-data-uri

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…-redact-base64-data-uri

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…-redact-base64-data-uri

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…-redact-base64-data-uri

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64
@kshitijk4poor
kshitijk4poor deleted the fix/langfuse-redact-base64-data-uri branch August 5, 2026 07:07
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…-redact-base64-data-uri

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…-redact-base64-data-uri

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64
fsca8 pushed a commit to fsca8/hermes-agent that referenced this pull request Oct 6, 2026
…-redact-base64-data-uri

fix(langfuse): redact base64 data URIs instead of truncating into invalid base64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants