You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generation input is missing the system prompt and conversation history #24
Since #17 (which fixed #1), generations have a non-null input — but it isn't what the model actually saw. Each generation's input only contains the messages since the previous generation:
first generation: the new user message plus tool definitions
every later generation: just the previous assistant message and the tool results after it
The system prompt never appears anywhere in the trace, earlier turns are never repeated, and tool definitions only show on the first generation. So when you open a generation in Langfuse, the input shown is not the prompt that was sent to the model, which makes prompt-level debugging impossible from the trace alone.
Why (on main, == v0.2.0): the plugin keeps a small per-session buffer — a new user message resets it (src/langfuse.ts:437-447), tool results are appended (:1136-1155), and when the next generation starts, the last assistant message plus that buffer becomes the generation's input and the buffer is cleared (:1119-1133, :340-350). Nothing accumulates the full history, and no event the plugin listens to carries the system prompt.
Repro:
opencode run "read package.json then summarize it"# open the second opencode.generation: input is just [assistant message, tool result]
Hello @DavidTraina, thank you for raising this! We have added a feature targeting your request last week. Feel free to let us now if you have follow up requests in the future.
@milanagm
hello! What about the system-prompt part of that request? Are there any future plans to implement it? For now, only user and assistant roles are included in the trace.
The UserMessage type has a system field, which holds a system prompt that the caller sends with the request. Though, OpenCode does not put its own system prompt in this field, meaning that in normal use the field is empty.
But there is a potential second way that I had investigated. The v2 agents endpoint GET /api/agent gives a system field for each agent, which is basically the system prompt of the agent. This endpoint usually gave me an empty value.
TLRD - for now I couldn't detect a reliable way to include it, which is why, for now, the system prompt is not visible.
Activity
bezbac commentedon Aug 18, 2026
Hi @DavidTraina, thanks also for this report. I'll compare the behavior with our other coding agent plugins, namely https://github.com/langfuse/claude-observability-plugin and https://github.com/langfuse/codex-observability-plugin, and see what the best path forward is here :)
milanagm commentedon Sep 8, 2026
Hello @DavidTraina, thank you for raising this! We have added a feature targeting your request last week. Feel free to let us now if you have follow up requests in the future.
apkrymov commentedon Sep 9, 2026
@milanagm
hello! What about the system-prompt part of that request? Are there any future plans to implement it? For now, only user and assistant roles are included in the trace.
milanagm commentedon Sep 9, 2026
Hello @apkrymov, valid question!
The UserMessage type has a system field, which holds a system prompt that the caller sends with the request. Though, OpenCode does not put its own system prompt in this field, meaning that in normal use the field is empty.
But there is a potential second way that I had investigated. The v2 agents endpoint GET /api/agent gives a system field for each agent, which is basically the system prompt of the agent. This endpoint usually gave me an empty value.
TLRD - for now I couldn't detect a reliable way to include it, which is why, for now, the system prompt is not visible.