[dotnet-port-fixes] Skip symlinked file-skill assets - #834
[dotnet-port-fixes] Skip symlinked file-skill assets#834Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens agent/skills/fsskills skill and asset discovery by skipping symlinked SKILL.md files (skill discovery) and skipping symlinked resource/script entries (asset discovery), aligning behavior with the upstream .NET hardening while keeping the Go public API unchanged.
Changes:
- Updated skill discovery to detect
SKILL.mdviaReadDirand ignore symlinkedSKILL.md. - Updated asset scanning to ignore symlinked entries during resource/script discovery.
- Added tests covering symlinked
SKILL.md, resource files, and script files.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| agent/skills/fsskills/source.go | Implements symlink skipping for skill and asset discovery. |
| agent/skills/fsskills/source_test.go | Adds tests to ensure symlinked SKILL.md and resource files are ignored. |
| agent/skills/fsskills/source_script_test.go | Adds a test to ensure symlinked script files are ignored. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| func isSymlinkEntry(entry fs.DirEntry) bool { | ||
| if entry.Type()&fs.ModeSymlink != 0 { | ||
| return true | ||
| } | ||
| info, err := entry.Info() | ||
| if err != nil { | ||
| return false | ||
| } | ||
| return info.Mode()&fs.ModeSymlink != 0 | ||
| } |
Parity Review — ✅ ApprovedThis PR is a direct port of the upstream .NET hardening change microsoft/agent-framework#7540. The changes are limited to internal discovery logic in Scope: Internal implementation only; no exported API surface changed.
|
Summary
Aligned
agent/skills/fsskillswith the upstream .NET hardening in microsoft/agent-framework#7540 by skipping symlinkedSKILL.mdfiles during skill discovery and skipping symlinked resource/script files during asset discovery. This keeps file-backed skills from following linked content outside the intended skill tree without changing the Go public API.Ported .NET PRs
94bbfb2ac8382450219afd978bbe17b7eb44efbfBreaking Changes
No. Existing exported Go symbols and signatures are unchanged; the change only excludes symlinked file-skill assets from discovery.
Tests and Examples
go test ./agent/skills/fsskillsSKILL.md, resource, and script filesNotes
This PR intentionally ports the narrow symlink-screening behavior that maps cleanly to the current Go
io/fsimplementation. It does not introduce API changes or broader file-system inspection behavior beyond the discovered file entries themselves.Closes #817