fix(langfuse): preserve Responses tool input items - #84186
Conversation
|
Privacy/history note after tracing the original implementation:
There is still a valid broader privacy concern: #67544 documents that content exports are unredacted, and open PR #64236 proposes explicit |
fix(langfuse): preserve Responses tool input items
No blocking issues found. The change is small, focused, and placed before the role-based path so Responses-style items bypass role handling entirely — looks right. |
fix(langfuse): preserve Responses tool input items
|
Summary
function_callfields in Langfuse generation inputsfunction_call_outputpayloads instead of rendering them asrole: null, content: null_safe_valuetruncation, JSON parsing, depth, and data-URI redaction rulesRoot cause
pre_api_requestpasses the actual Responses APIinputarray to the Langfuse plugin, but_serialize_messages()treated every item as a chat message and retained onlyroleandcontent. Responses tool items usetype,call_id,name,arguments, andoutput, so those fields were dropped from the generation observation.Test plan
function_callandfunction_call_outputserializationHERMES_PYTHON=$(PYENV_VERSION=3.12.12 pyenv which python) scripts/run_tests.sh tests/plugins/test_langfuse_plugin.py -q(25 passed)PYENV_VERSION=3.12.12 python -m ruff check plugins/observability/langfuse/__init__.py tests/plugins/test_langfuse_plugin.py