Conversation
|
Hi @suolongcn. I’m currently preparing the plugin for OpenCode 2 and expect to release it officially on Monday. This may cause some conflicts; if you could resolve them afterward, that would be great. I’ll take another look once everything is finalized. Ideally, please monitor the releases for the OpenCode 2-compatible version. Thanks! |
Okay! Looking forward to the new release! |
…lity-plugin into fix/38-semantic-tool-names
|
@bezbac I have modified this PR and verifyed this function with opencode v1 and opencode v2. Please help me to review this PR. |
OpenCode exports skill invocations as
skill. Subagent invocations are exported astaskwithsubagent_typein OpenCode v1 and assubagentwithagentin OpenCode v2, preventing Langfuse dashboards from grouping usage by skill name or subagent type.Name these tool observations
skill:<name>,task:<subagent_type>, orsubagent:<agent>, trimming surrounding whitespace and falling back to the original tool name for missing, blank, or non-string values. Preserve the original inputs and tool metadata. The shared span creation path covers execution hooks and observations reconstructed from completed or failed message parts.Add integration coverage for semantic names, fallback values, unchanged inputs and metadata, parent relationships, duplicate hook/message events, and OpenCode v1/v2 subagent payloads.
Validation:
pnpm run formatpnpm run buildpnpm run lintpnpm run test:integration(39 tests passed)Closes #38.
Local Langfuse verification
Verified commit
ab787fcagainst local OpenCode 2 and self-hosted Langfuse4.37.0. The built local plugin was loaded through the OpenCode 2 plugin system while keeping the published-package config unchanged, then real OpenCode 2 skill and subagent executions were exported through the Langfuse span processor and checked in Langfuse.skill:<name>andtask:<subagent_type>.skill:<name>.subagent:<agent>; OpenCode 2 exports sub-agent invocations assubagentnodes with anagentinput field, not v1-styletasknodes withsubagent_type.pnpm run format,pnpm run build, andpnpm run test:integrationpassed locally with 39 integration tests.Skill input and output(opencode v1)
Subagent input and output(opencode v1)
Skill input and output(opencode v2)
Subagent input and output(opencode v2)
Please note that in OpenCode V2, sub-agent invocations are no longer represented as task nodes in the trace, but as subagent nodes. The semantic observation name is expected to be

subagent:<agent>.