Skip to content

feat(agent/agentcontext): load skills bundled in Agent Plugins - #32296

Draft
f0ssel wants to merge 4 commits into
garrett/agent-plugins/02-plugin-discoveryfrom
garrett/agent-plugins/02b-plugin-skills
Draft

f0ssel wants to merge 4 commits into
garrett/agent-plugins/02-plugin-discoveryfrom
garrett/agent-plugins/02b-plugin-skills

Conversation

@f0ssel

@f0ssel f0ssel commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

A valid Agent Plugin now emits one skill per directory under its skills/ container that holds a SKILL.md, attributed to the plugin through PluginName. A scan root that is itself a plugin hands its skills/ to the plugin instead of scanning it as a plain skill container.

Per spec section 4.1, skills/ and each skill directory may be symlinks whose targets stay inside the canonical plugin root. A skill whose directory or SKILL.md escapes the root is reported as invalid. An escaping, unreadable, or non-directory skills/ disables the plugin's skills and puts a warning on the plugin. Skill names and descriptions are checked against the Agent Skills limits (64 and 1024 characters). applyCaps ranks plugins directly ahead of skills so a count cut that keeps a plugin's skills also keeps the plugin, and skills of an excluded plugin are dropped.

Discovery is still off until the next PR wires the manifest flag. Split out of #32265; together they match the previous #32265.

Part 3 of the #29321 split.

Stack (base main, replaces #29321–#30577):

PR Title Size
#32264 feat: carry Agent Plugin fields through context snapshots +542/-213
#32265 feat(agent/agentcontext): discover and validate Agent Plugins manifests +1951/-74
👉 #32296 feat(agent/agentcontext): load skills bundled in Agent Plugins +653/-19
#32266 feat(agent): enable Agent Plugins discovery from the manifest +988/-79
#32267 feat(coderd/x): add plugin skill source and alias grammar +138/-32
#32268 feat: add plugin skill and plugin context resource types +295/-161
#32269 feat(coderd): serve plugin skills in chatd +1338/-386
#32270 feat(agent/x/agentmcp): accept streamable-http MCP type, add plugin data dir helper +92/-0
#32271 feat(agent/x/agentmcp): add a same-origin header HTTP client +547/-4
#32272 feat(agent): load plugin mcp.json and reload registered MCP sources +1262/-228
#32273 test(agent/x/agentmcp): cover plugin mcp.json parsing, reloads, isolation, and env +2044/-2
#32274 feat: run plugin MCP servers discovered by agentcontext +851/-26
#32275 feat(site/src): render Agent Plugin context +1349/-240

Generated by Claude Code

A valid plugin now emits one KindSkill per directory under its skills/
container that holds a SKILL.md, attributed to the plugin through
PluginName. A scan root that is itself a plugin hands its skills/ to the
plugin instead of scanning it as a plain skill container.

Per spec section 4.1, skills/ and each skill directory may be symlinks
whose targets stay inside the canonical plugin root. A skill whose
directory or SKILL.md escapes the root is reported as invalid; an
escaping, unreadable, or non-directory skills/ disables the plugin's
skills with a warning on the plugin. Skill names and descriptions are
checked against the Agent Skills limits of 64 and 1024 characters.

applyCaps ranks KindPlugin directly ahead of KindSkill so a count cut
that keeps a plugin's skills also keeps the plugin, and skills of a
plugin that a cap excluded are dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@f0ssel
f0ssel force-pushed the garrett/agent-plugins/02b-plugin-skills branch from beccf2b to 9461989 Compare November 16, 2026 23:25
@f0ssel

f0ssel commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T17:33:35.274080Z 398adfe Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9461989d5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent/agentcontext/plugin.go Resolved
@f0ssel
f0ssel marked this pull request as ready for review November 17, 2026 03:16
@f0ssel
f0ssel removed the request for review from hugodutka November 17, 2026 16:34
@f0ssel

f0ssel commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 398adfecf4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

res.Error = strings.Join(manifest.Warnings, "; ")
warnings := manifest.Warnings

skills, warn := r.pluginSkills(pluginRoot, root, manifest.Name)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Watch discovered plugin skill directories

When plugins are enabled, this loads skills from <scan-root>/{plugins,.agents/plugins}/<plugin>/skills, but Watcher.collectDirs in agent/agentcontext/watcher.go:320-352 still watches only the scan root and ordinary containers returned by skillContainersFor(root.Path). Consequently, editing an existing plugin SKILL.md or adding/removing a bundled skill produces no fsnotify event, so the Manager continues serving the initial snapshot until an unrelated event or explicit resync; watcher synchronization needs to include discovered plugin skill containers and their immediate skill directories.

Useful? React with 👍 / 👎.

Comment on lines +679 to +680
metaInfo, err := os.Lstat(meta)
if err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject non-regular SKILL.md files before reading

When a plugin skill contains a non-symlink FIFO named SKILL.md, Lstat succeeds here and readSkillMeta eventually calls os.ReadFile without checking Mode().IsRegular(), blocking the entire resolution pass indefinitely while waiting for a writer. The Agent Plugins skill discovery contract only discovers SKILL.md paths that resolve to regular files, so direct special files should be skipped or rejected before invoking readSkillMeta.

Useful? React with 👍 / 👎.

@f0ssel
f0ssel marked this pull request as draft November 19, 2026 18:23
@f0ssel f0ssel assigned garrettatcoder and unassigned f0ssel Nov 20, 2026

This branch has not been deployed

No deployments
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.

2 participants