Skip to content

fix(langfuse-exporter): update langfuse sdk to handle non-JSON error responses#1110

Merged
omeraplak merged 1 commit intoVoltAgent:mainfrom
pandego:fix/670-langfuse-json-response
Feb 28, 2026
Merged

fix(langfuse-exporter): update langfuse sdk to handle non-JSON error responses#1110
omeraplak merged 1 commit intoVoltAgent:mainfrom
pandego:fix/670-langfuse-json-response

Conversation

@pandego
Copy link
Contributor

@pandego pandego commented Feb 25, 2026

Fixes #670

Summary

  • bump langfuse in @voltagent/langfuse-exporter from ^3.37.2 to ^3.38.6
  • include a changeset for the package release

Why

Issue #670 reports SyntaxError: Failed to parse JSON from the Langfuse SDK on non-JSON error responses during export calls. This updates to the latest 3.x patch level with upstream handling improvements.

Validation

  • pnpm --filter @voltagent/langfuse-exporter lint
  • pnpm --filter @voltagent/langfuse-exporter test
  • pnpm --filter @voltagent/langfuse-exporter build

Summary by cubic

Update langfuse-exporter to use Langfuse ^3.38.6 so non-JSON error responses during export retries are handled correctly. Adds a changeset for a patch release; fixes #670.

Written for commit 36850c1. Summary will update on new commits.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed handling of non-JSON error responses during export retries in the Langfuse exporter.

@changeset-bot
Copy link

changeset-bot bot commented Feb 25, 2026

🦋 Changeset detected

Latest commit: 36850c1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@voltagent/langfuse-exporter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

The PR updates the langfuse dependency from ^3.37.2 to ^3.38.6 in the langfuse-exporter package to fix a bug where non-JSON error responses caused parsing failures during export retry operations.

Changes

Cohort / File(s) Summary
Dependency Bump
.changeset/fuzzy-turkeys-smell.md, packages/langfuse-exporter/package.json
Langfuse dependency bumped from ^3.37.2 to ^3.38.6 to address upstream fixes for JSON parsing errors when handling non-JSON error responses.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A JSON bug made responses fail,
Error handling told a sad tale,
But hop! Version bump saves the day,
Now non-JSON responses parse the right way! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main change: updating the langfuse SDK to handle non-JSON error responses, which directly addresses the primary objective of fixing issue #670.
Linked Issues check ✅ Passed The PR successfully addresses issue #670 by upgrading langfuse from ^3.37.2 to ^3.38.6, which includes upstream handling improvements for non-JSON error responses during export calls.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing issue #670: a dependency update to langfuse-exporter and a changeset entry for release tracking, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description is comprehensive and follows the template structure with all key sections completed, including linked issue, summary, rationale, and validation steps performed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.changeset/fuzzy-turkeys-smell.md (1)

5-5: Add a regression test reference for #670.

This note captures the dependency update, but it would be safer to also add/track a regression test that simulates non-JSON Langfuse error bodies so this behavior doesn’t regress silently.

I can draft a focused Vitest test case for the exporter path that reproduces #670 if you want.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/fuzzy-turkeys-smell.md at line 5, Add a Vitest regression test
for the langfuse-exporter that simulates Langfuse returning non-JSON error
bodies during the exporter retry path: create a test (e.g.,
tests/langfuse-exporter/non-json-error-regression.test.ts) that invokes the
exporter entrypoint function responsible for sending batches (the
export/sendBatch/exportWithRetries function used by the langfuse-exporter) and
mock the HTTP client to return a 5xx response with a plain-text/non-JSON body on
the first attempts and a success or final failure afterward; assert the code
does not throw unhandled parsing exceptions, that retry logic still runs, and
that the exported result/error is handled as expected to prevent regression for
`#670`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.changeset/fuzzy-turkeys-smell.md:
- Line 5: Add a Vitest regression test for the langfuse-exporter that simulates
Langfuse returning non-JSON error bodies during the exporter retry path: create
a test (e.g., tests/langfuse-exporter/non-json-error-regression.test.ts) that
invokes the exporter entrypoint function responsible for sending batches (the
export/sendBatch/exportWithRetries function used by the langfuse-exporter) and
mock the HTTP client to return a 5xx response with a plain-text/non-JSON body on
the first attempts and a success or final failure afterward; assert the code
does not throw unhandled parsing exceptions, that retry logic still runs, and
that the exported result/error is handled as expected to prevent regression for
`#670`.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d031576 and 36850c1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • .changeset/fuzzy-turkeys-smell.md
  • packages/langfuse-exporter/package.json

Copy link
Member

@omeraplak omeraplak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much 🔥

@omeraplak omeraplak merged commit 8c8aa14 into VoltAgent:main Feb 28, 2026
19 of 22 checks passed
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.

[BUG] Langfuseexporter fails on json response

2 participants