Skip to content

[dotnet-port-fixes] Skip symlinked file-skill assets - #834

Open
Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
mainfrom
copilot/fsskills-symlink-skip-ed0c29c88befa75e
Open

[dotnet-port-fixes] Skip symlinked file-skill assets#834
Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
mainfrom
copilot/fsskills-symlink-skip-ed0c29c88befa75e

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Summary

Aligned agent/skills/fsskills with the upstream .NET hardening in microsoft/agent-framework#7540 by skipping symlinked SKILL.md files 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

Breaking 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/fsskills
  • Added parity coverage for symlinked SKILL.md, resource, and script files

Notes

This PR intentionally ports the narrow symlink-screening behavior that maps cleanly to the current Go io/fs implementation. It does not introduce API changes or broader file-system inspection behavior beyond the discovered file entries themselves.

Generated by .NET to Go Fixes and Test Porting Agent · gpt54 · 176.2 AIC · ⌖ 11.6 AIC · ⊞ 24.2K ·

Closes #817

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md via ReadDir and ignore symlinked SKILL.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.

Comment on lines +549 to +558
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
}
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review — ✅ Approved

This PR is a direct port of the upstream .NET hardening change microsoft/agent-framework#7540. The changes are limited to internal discovery logic in agent/skills/fsskills/source.go — no exported Go symbols, option shapes, or user-visible behavior are added or modified.

Scope: Internal implementation only; no exported API surface changed.
Parity: Go behavior now matches the upstream .NET symlink-skipping guard for file-skill discovery. No Python equivalent exists (file-backed skills are Go/C# specific).
Label: public-api-change not applied — no exported API changes.

Generated by Go API Consistency Review Agent for #834 · sonnet46 · 14.6 AIC · ⌖ 5.6 AIC · ⊞ 5.7K ·

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-port-fixes] Skip symlinked file-skill assets

2 participants