Skip to content

Traces show input but no output; generations show output but no input #1

Description

@DerJacques

In the Langfuse UI, traces produced by this plugin only ever show input; they never show output. Conversely, the nested opencode.generation observations have output but no input. As a result, no single observation (trace or generation) has a paired input + output, which makes it impractical to build LLM-as-judge evaluators on these traces.

Here are some example of what that looks like:

Image Image

Please note that this is my first time using Langfuse, but I would have expected a different behavior based on the short video in https://langfuse.com/docs/observability/get-started#see-your-trace-in-langfuse.

Reproduction

  1. Enable the plugin per the README:
    {
      "experimental": { "openTelemetry": true },
      "plugin": ["@langfuse/opencode-observability-plugin@latest"]
    }
  2. Run any prompt with opencode run "say hello" (or via the TUI).
  3. Open the resulting trace in Langfuse.

Observed:

  • The trace pane shows the user prompt as input, but output is empty.
  • Click into the trace to see observations:
    • opencode.turn (root, drives trace-level I/O) — has input, no output.
    • opencode.generation — has output, no input.

Expected: at least one of the observations should carry both the input and the output of the LLM call, so users can run trace-level or observation-level LLM judges without manually joining sibling spans.

Root cause (from reading the source)

In src/langfuse.ts:

  • traceUserMessage creates the opencode.turn root span and sets langfuse.observation.input to the formatted user message. It never sets langfuse.observation.output on this span — neither at creation nor later when the turn finishes.
  • traceGeneration / startActiveGenerationStep create the nested opencode.generation span and set langfuse.observation.output (assistant text), model.name, usage_details, cost_details. They never set langfuse.observation.input.

Since Langfuse derives trace-level input/output from the root observation's attributes, the missing output on opencode.turn is what surfaces in the UI as the empty trace output column.

Environment

  • Plugin: @langfuse/opencode-observability-plugin (latest as of filing)
  • OpenCode: 1.17.9
  • Configuration: experimental.openTelemetry: true, plugin loaded from opencode.json

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions