Skip to content

fix(trace): add explicit ids to Langfuse generation#37833

Open
MEGHADESAI5 wants to merge 1 commit into
langgenius:mainfrom
MEGHADESAI5:fix-langfuse-generation-id
Open

fix(trace): add explicit ids to Langfuse generation#37833
MEGHADESAI5 wants to merge 1 commit into
langgenius:mainfrom
MEGHADESAI5:fix-langfuse-generation-id

Conversation

@MEGHADESAI5

Copy link
Copy Markdown

Summary

This PR adds explicit observation IDs to Langfuse generation events created in:

  • message_trace
  • suggested_question_trace

Problem

add_generation() sends generation events through the Langfuse ingestion API. When LangfuseGeneration.id is not provided, filter_none_values() removes the field and the resulting CreateGenerationBody is created with id=None.

This can result in generation observations being dropped by Langfuse, causing traces to be created without corresponding generation records.

Changes

  • Added id=str(uuid.uuid4()) to generation creation in message_trace
  • Added id=str(uuid.uuid4()) to generation creation in suggested_question_trace

Related

Fixes #37824

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

1 participant