Skip to content

feat(agent): enable Agent Plugins discovery from the manifest - #32266

Draft
f0ssel wants to merge 16 commits into
garrett/agent-plugins/02b-plugin-skillsfrom
garrett/agent-plugins/03-plugin-wiring
Draft

f0ssel wants to merge 16 commits into
garrett/agent-plugins/02b-plugin-skillsfrom
garrett/agent-plugins/03-plugin-wiring

Conversation

@f0ssel

@f0ssel f0ssel commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Manager.SetPluginsEnabled turns plugin discovery on or off and re-resolves on change; the agent sets it from Manifest.AgentPluginsEnabled. The fsnotify watcher watches plugin containers, plugin directories, and plugin skill directories when enabled, serializes syncs, and re-adds replaced directories. The agent logs which working-directory entries it does not scan when the template sets no dir. Adds the Agent Plugins (experimental) docs section.

With this PR the stack matches #29321.

Part 4 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

f0ssel and others added 2 commits November 16, 2026 11:37
The resolver recognizes Agent Plugins (agent-plugins.org, spec 1.0.0)
directories when ResolveOptions.PluginsEnabled is set and emits them as
KindPlugin resources with their skills attributed to the plugin.
Resolve, and the Manager until the next change wires the flag, keep
plugin discovery off.

Discovery: a plugin is an immediate child of plugins/ or
.agents/plugins/ under a scan root, or a scan root that itself holds a
plugin.json. A plugin.json at a scan root or in plugins/ whose $schema
is absent or not an https://agent-plugins.org/schemas/ URL may belong
to another tool and is ignored after a debug log. In .agents/plugins/
every plugin.json is taken as an Agent Plugins manifest and every
problem is reported as an invalid plugin with the reason.

Validation follows spec section 5: name grammar (via
workspacesdk.ValidatePluginName), optional string fields, keywords as
strings, closed author object, extensions as object. Unknown top-level
fields are recorded in Resource.Error while the status stays OK; other
violations reject the plugin and load none of its skills. Version and
description are stripped of U+0000 and capped at 64 and 1024 runes.

The plugin root is canonicalized once and is the containment boundary
for plugin.json, skills/, each skill directory, and every SKILL.md; per
spec section 4.1 each may be a symlink that resolves inside the root.
Symlinked plugin directories and plugin containers are skipped, as are
paths longer than workspacesdk.MaxContextSourceBytes or names that are
not valid UTF-8.

Resources are deduplicated on Source, across kinds, since coderd
rejects a push that repeats one. Skills are deduplicated by (PluginName,
Name), so a plugin skill and a plain skill of the same name both
survive. A plugin name already claimed by an earlier root makes later
same-named plugins invalid. The resolver drops excluded rows past
workspacesdk.MaxContextResources and drops skills whose plugin is not
OK after the caps.

The built-in ~/.claude/plugins/cache scan root is removed: Claude's
.claude-plugin manifests are not read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VpiVZBgFqiSdRKrH8dPSPT
Manager.SetPluginsEnabled stores the flag and re-resolves on change;
both resolve paths pass it to the resolver through ResolveOptions. The
agent sets it from Manifest.AgentPluginsEnabled on every manifest. With
it off, the resolver reads no plugin.json, a scan root's skills/ holds
plain skills, and no plugin directories are watched. Watcher syncs are
serialized and each reads the current scan roots and options, so an
older root set never replaces a newer one.

With plugins enabled, the fsnotify watcher registers the plugin
containers under each scan root (or the existing parent of a missing
.agents/plugins), each immediate plugin directory, its skills/
container, and the skill directories the resolver would read, and
treats plugin.json events as relevant. Sync publishes each directory's
watch role through an atomic pointer, so filtering an event never waits
on a Sync blocked in fsnotify Add or Remove on Windows. The watcher
re-adds a watched directory that was removed or renamed since the last
Sync, and the debounce timer has its own lock.

When the manifest has no directory the agent logs, at Info and again
only when Manifest.AgentPluginsEnabled changes, the working-directory
entries it does not scan, pointing at ~/.coder/.agents/plugins when
plugins are on.

The extending-agents docs gain an Agent Plugins (experimental) section,
and the platform controls experiments list links to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VpiVZBgFqiSdRKrH8dPSPT
f0ssel and others added 7 commits November 16, 2026 11:42
The resolver lists plugin container children with immediateSubdirs, so
it lands with discovery rather than with the watcher change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VpiVZBgFqiSdRKrH8dPSPT
Resync and resolveAndBroadcast pass the Manager's ResolveOptions to the
resolver. pluginsEnabled stays false until SetPluginsEnabled lands with
the manifest wiring, so the next change only adds the setter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VpiVZBgFqiSdRKrH8dPSPT
Document where a plugin's skills live and the description requirement
plugin skills have from discovery on, and say that an invalid plugin
appears in the context list with its error. The chat-side plugin skill
behavior is added with chatd support.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VpiVZBgFqiSdRKrH8dPSPT
@f0ssel f0ssel self-assigned this Nov 16, 2026
@f0ssel
f0ssel added this pull request to stack #32278 November 16, 2026 18:37
@f0ssel
f0ssel removed this pull request from stack #32278 November 16, 2026 22:43
@f0ssel
f0ssel changed the base branch from garrett/agent-plugins/02-plugin-discovery to garrett/agent-plugins/02b-plugin-skills November 16, 2026 22:43
@f0ssel
f0ssel added this pull request to stack #32297 November 16, 2026 22:43
@f0ssel
f0ssel force-pushed the garrett/agent-plugins/03-plugin-wiring branch from 3241be9 to 2b8b73a Compare November 16, 2026 23:25
Comment thread agent/agentcontext/manager.go Resolved
@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-18T02:50:05.351805Z b437cbf 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: 8ccd0b51bb

ℹ️ 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/watcher.go Resolved
A removed directory was copied into the new watch set before its re-add,
so a failed Add (or one skipped after ENOSPC) left it marked as watched
and later Syncs never retried it. Keep removed directories only once the
re-add succeeds.
@f0ssel

f0ssel commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 7b557c1838

ℹ️ 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".

@f0ssel
f0ssel marked this pull request as ready for review November 18, 2026 02:40
@f0ssel
f0ssel requested a review from mafredri November 18, 2026 02:40
kqueue treats Add on an already-watched path as a no-op, so revoking
read permission cannot make the re-add fail on macOS.
@f0ssel

f0ssel commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: b437cbf608

ℹ️ 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".

@f0ssel
f0ssel marked this pull request as draft November 19, 2026 14:46
@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