Skip to content

feat: expose skill and subagent names in tool observations - #40

Open
suolongcn wants to merge 3 commits into
langfuse:mainfrom
suolongcn:fix/38-semantic-tool-names
Open

suolongcn wants to merge 3 commits into
langfuse:mainfrom
suolongcn:fix/38-semantic-tool-names

Conversation

@suolongcn

@suolongcn suolongcn commented Sep 18, 2026

Copy link
Copy Markdown

OpenCode exports all skill invocations as skill and all subagent spawns as task, preventing Langfuse dashboards from grouping usage by skill name or subagent type.

Name these tool observations skill:<name> and task:<subagent_type>, 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 README documentation and integration coverage for semantic names, fallback values, unchanged inputs and metadata, parent relationships, and duplicate hook/message events.

Validation:

  • pnpm run format
  • pnpm run build
  • pnpm run lint
  • pnpm run test:integration (27 tests passed)

Closes #38.

Local Langfuse verification

Verified commit 17496b8 against self-hosted Langfuse 4.37.0. The built plugin received deterministic OpenCode hook/event fixtures and exported through the real Langfuse span processor. Persisted data was checked through the API and in the UI. This tests plugin-to-Langfuse integration, not live LLM or subagent execution.

  • All seven scenarios passed: named skill, named subagent, ordinary tool, whitespace-only name, non-string subagent type, completion-only event, and error-only event.
  • Original inputs and tool metadata were preserved; all tool observations had the generation as parent and appeared exactly once.
  • pnpm run format, pnpm run build, and all 27 integration tests passed.
  • The temporary verification API key was deleted after validation. Screenshots omit the account sidebar.

Trace hierarchy

Trace hierarchy showing semantic tool names and fallbacks

Skill input and output

Skill observation named skill:resolve-dependencies

Subagent input and output

Subagent observation named task:developer

Failed tool observation

Failed task:reviewer observation retains its semantic name and error

@CLAassistant

CLAassistant commented Sep 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@bezbac

bezbac commented Sep 18, 2026

Copy link
Copy Markdown
Member

Hi @suolongcn. I鈥檓 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鈥檒l take another look once everything is finalized. Ideally, please monitor the releases for the OpenCode 2-compatible version. Thanks!

@suolongcn

Copy link
Copy Markdown
Author

Hi @suolongcn. I鈥檓 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鈥檒l 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: expose skill and subagent names for Langfuse analytics

3 participants