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
Feature: Add sessionID to experimental.chat.system.transform hook for tracing integration #6142
When building observability plugins (e.g., Langfuse, OpenTelemetry exporters), it's valuable to capture the full system prompt for each LLM request and associate it with the correct trace/session. The experimental.chat.system.transform hook provides access to the system prompt, but currently lacks the sessionID needed to correlate it with a specific session.
Current Behavior
In packages/opencode/src/session/llm.ts line ~65:
awaitPlugin.trigger("experimental.chat.system.transform",{},{ system })
The input object is empty {}, so plugins cannot determine which session the system prompt belongs to.
Proposed Change
Pass the sessionID in the input:
awaitPlugin.trigger("experimental.chat.system.transform",{sessionID: input.sessionID},{ system })
And update the type definition in packages/plugin/src/index.ts:
This issue might be a duplicate of existing issues. Please check:
Feature Request: Add Langfuse Tracing #219: Feature Request: Add Langfuse Tracing - This issue is about integrating Langfuse for tracing/observability in OpenCode, which is directly related to your use case of building a Langfuse exporter plugin.
Feel free to ignore if this doesn't address your specific case.
Activity
github-actions commentedon Dec 25, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if this doesn't address your specific case.
rekram1-node commentedon Dec 25, 2025
sure pr welcome!
thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
ngbrown commentedon Apr 14, 2026
Session ID is present in the following (at least with Opencode 1.4.3):