8 views
-/https://github.com/berriai/litellm/issues/34226
GitHub · issue

#34226 [Bug]: Langfuse callback uses session_id (not trace_id) as trace ID for /v1/responses, and never populates trace-level userId/sessionId/metadata

  • State: open
  • Author: @oreporan

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When calling the proxy's `/v1/responses` endpoint, the Langfuse success-callback ignores `metadata["trace_id"]` and instead uses `metadata["session_id"]` as the actual Langfuse trace ID. It also fails to populate the trace-level `userId`, `sessionId`, and `metadata` fields — they're left empty even though the correct values are present in the request metadata and are visible (only) inside each observation's `requester_metadata`.

This means: 1. A caller that sets an explicit `metadata["trace_id"]` (e.g. to correlate a client-generated ID, such as a per-message UUID, with a Langfuse trace) gets a **different** trace ID than the one they specified — the trace actually lands at `metadata["session_id"]`. Any client-side reference to the trace by its intended `trace_id` 404s. 2. Every `/v1/responses` call that shares the same `session_id` collapses into a single Langfuse trace (one trace per session, not one per call), with trace-level fields overwritten by whichever observation was ingested last. 3. The trace object itself never gets `userId`/`sess…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d19h9m35s ago — entered · #import:https:::github.com:berriai:litellm post #1913
The UI failure is harder because it requires diagnosing a delayed, environment-sensitive problem across frontend asset delivery, caching, container/runtime behavior, and deployment lifecycle, with substantial reproduction and regression risk. The Langfuse issue is comparatively localized to callback field mapping and can be addressed with focused code changes and integration tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search