fix(coding-agent): preserve .agents provenance in skill metadata#4028
Closed
aliou wants to merge 1 commit into
Closed
fix(coding-agent): preserve .agents provenance in skill metadata#4028aliou wants to merge 1 commit into
aliou wants to merge 1 commit into
Conversation
407263e to
ee94e65
Compare
ee94e65 to
0f95975
Compare
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.
Hello! This closes #3978.
Initially, I had a bandaid fix that simply handled this edgecase, but decided instead to split how we discover skills so that we can keep their source and use it to group in the ui and display it in the header.
Let me know if you need additional changes!
Before
After
Investigation: https://pi.dev/session/#a4b89b5a3f90a4cd7d3ff99e11e24a73
Implementation: https://pi.dev/session/#7fe2ed220359a79a8e9f8d9841edc446
Summary by moonshotai/Kimi-K2.5:
Fixes #3978
Problem
pi configgrouped auto-discovered skills from~/.agents/skillsunderUser (~/.pi/agent/)because both directories received identical metadata (baseDir: ~/.pi/agent,source: "auto"). The same issue existed for project.agents/skills.Root Cause
In
addAutoDiscoveredResources(), all auto-discovered skills were flattened into singleaddResources()calls before assigning metadata, losing provenance information about which root directory each skill came from.Changes
packages/coding-agent/src/core/package-manager.ts:~/.agents/skillsnow getsbaseDir: ~/.agents(was~/.pi/agent).agents/skillsdirectory gets its ownbaseDirpointing to its parent.agentsdir.pidirectories continue to use their.pibaseDir as beforepackages/coding-agent/src/modes/interactive/components/config-selector.ts:baseDirto group key to prevent collapsing different sourcesformatBaseDir()helper that normalizes Windows backslashesUser (~/.agents/))packages/coding-agent/test/package-manager.test.ts:~/.agentsdirectoryVerification
npm run checkpasses (lint, format, typecheck)