Populate OpenCode skills and subagents breakdowns#557
Open
KevNev19 wants to merge 1 commit into
Open
Conversation
The Skills & Agents panel was always empty for OpenCode sessions even when skills and subagents were used. buildAssistantCall (shared by the OpenCode SQLite and file-based parsers, and Kilo Code) counted the skill/task tool invocations but never read the skill name or subagent type from the tool-call input, so the dedicated breakdowns had no names to aggregate. In OpenCode's part files the identifier lives in state.input: the skill tool carries input.name and the task tool carries input.subagent_type. Extract both in buildAssistantCall and surface them on ParsedProviderCall.skills / .subagentTypes, then stop hard-coding skills: [] in providerCallToTurn and providerCallToCachedCall so the classifier's subCategory and the subagent breakdown receive the data. Verified against real OpenCode data: the previously empty skills[] and subagents[] now populate (pipeline-investigation, plan-spec, splunk, ... and explore/general subagents). Fixes getagentseal#556
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Populate the Skills & Agents breakdown for OpenCode sessions. Before this change the panel always showed "No skill/agent usage" for OpenCode, even when skills and subagents were used — while the Core Tools panel correctly counted the
SkillandAgenttool invocations.Fixes #556.
Root cause
buildAssistantCall(insrc/providers/session-message.ts, shared by the OpenCode SQLite parser, the OpenCode file-based parser, and Kilo Code) built thetoolslist from tool parts but never read the name of the skill / subagent from the tool-call input. The resultingParsedProviderCallcarried noskillsand nosubagentTypes, so:providerCallToTurn/providerCallToCachedCallhard-codedskills: [], so the classifier never setsubCategory→ emptyskillBreakdown.subagentTypeswasundefined→ emptysubagentBreakdown.In OpenCode's on-disk format the identifier lives in
state.input:Change
ParsedProviderCallgains an optionalskills?: string[](mirrors the existingsubagentTypes?).buildAssistantCallextractsskills(fromskilltoolinput.name) andsubagentTypes(fromtasktoolinput.subagent_type) using.filter/.map(no bracket-assign, so the hot-path Semgrep rule is satisfied).providerCallToTurnandproviderCallToCachedCallpasscall.skills ?? []instead of[].The downstream classifier
subCategorygate (category === 'general') is intentionally left unchanged — it already has dedicated test coverage and is shared with the Claude path. This PR only fills the missing upstream extraction; subagents (no gate) always show, and skills show for general-category turns exactly as they do for Claude.Tests
tests/providers/opencode-file.test.ts: skill/subagent extraction fromskill/taskparts, and the empty case.npx tsc --noEmitclean;npm run buildsucceeds.Verification on real data
Ran the built CLI against a real OpenCode file-store. Previously empty, now populated: