hermes - 💡(How to fix) Fix [Bug]: Langfuse traces missing LLM input/output and tool output [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

Report       https://paste.rs/b2MNF
  agent.log    https://dpaste.com/CPWQ2JA8W
  gateway.log  https://dpaste.com/45KYY968F
RAW_BUFFERClick to expand / collapse

Bug Description

Langfuse receives traces from Hermes, but with two critical issues:

  1. LLM generation inputs missing and outputs don't include the LLM response
  2. Tool arguments are visible, but tool outputs are undefined

This causes langfuse plugin to have very little value since the main points of interest for observability are missing.

Steps to Reproduce

  1. set up langfuse side
  2. enable langfuse plugin
  3. chat with hermes and ask for a tool call
  4. observe in langfuse LLM generation that input and output are missing
  5. observe in langfuse Tool that tool output is missing

Expected Behavior

Langfuse should show LLM input and output and tool output

Actual Behavior

langfuse LLM generation that input and output are missing and tool output is undefined

Affected Component

Other: Langfuse plugin and potentially other hooks

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

  Report       https://paste.rs/b2MNF
  agent.log    https://dpaste.com/CPWQ2JA8W
  gateway.log  https://dpaste.com/45KYY968F

Operating System

Debian 13

Python Version

3.11.15

Hermes Version

v0.13.0 (2026.5.7)

Root Cause Analysis (optional)

  1. LLM generation inputs were empty and outputs don't include the LLM response. on_pre_llm_request read only the messages kwarg, but depending on Hermes version and call path the actual request payload arrives as request_messages, conversation_history, or user_message. Generations showed an empty input instead of the real outbound message list.

  2. Tool observations had no output. The Tool: <name> child span in Langfuse showed input (arguments) but Output: undefined. Root cause: when Hermes fires pre_tool_call and post_tool_call without a tool_call_id (the common case for most built-in and registry tools), the plugin stored the observation under a unique time.time_ns()-based key in on_pre_tool_call that on_post_tool_call could never reconstruct. The post hook fell back to popitem() which is unreliable under concurrent tool calls. Every tool span ended up closed by the _finish_trace sweep with no output set.

Proposed Fix (optional)

Opened PR with fix: #22345

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: Langfuse traces missing LLM input/output and tool output [1 pull requests]