Skip to content

feat(agent/agentcontext): discover and validate Agent Plugins manifests - #32265

Draft
f0ssel wants to merge 3 commits into
garrett/agent-plugins/01-context-transportfrom
garrett/agent-plugins/02-plugin-discovery
Draft

f0ssel wants to merge 3 commits into
garrett/agent-plugins/01-context-transportfrom
garrett/agent-plugins/02-plugin-discovery

Conversation

@f0ssel

@f0ssel f0ssel commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

The agentcontext resolver recognizes Agent Plugins (agent-plugins.org, spec 1.0.0) when ResolveOptions.PluginsEnabled is set: each child of plugins/ or .agents/plugins/ under a scan root, or a scan root holding a plugin.json. Manifests are validated against spec section 5, and plugin.json must resolve inside the canonical plugin root. Skills bundled in a plugin are loaded by #32296. Resources are deduplicated on Source (coderd rejects repeats), skills on (plugin, name), and the snapshot is capped at MaxContextResources. The built-in ~/.claude/plugins/cache scan root is removed.

Discovery stays off in this PR; the Manager passes ResolveOptions{} until the next PR wires the manifest flag. About 1k of the ~1.95k added lines are tests.

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

The resolver recognizes Agent Plugins (agent-plugins.org, spec 1.0.0)
directories when ResolveOptions.PluginsEnabled is set and emits them as
KindPlugin resources. Resolve, and the Manager until a later change
wires the flag, keep plugin discovery off. Skills bundled in a plugin
are loaded by the next change.

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. 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, which 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.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@f0ssel
f0ssel removed this pull request from stack #32278 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/02-plugin-discovery branch from 3809fca to e0d2354 Compare November 16, 2026 22:43
Comment thread agent/agentcontext/resolve.go Resolved
Comment thread agent/agentcontext/plugin.go Resolved
Comment thread agent/agentcontext/plugin.go Resolved
parsePluginManifest decodes the schema-defined keys into a struct
instead of checking each field by hand. manifestString rejects JSON
null, which encoding/json would otherwise treat as absent, and only
the exact schema keys are decoded because encoding/json matches keys
case-insensitively.

readPluginManifest returns the file and a *resourceError instead of
writing status and error through a *Resource. withoutNUL replaces the
inline U+0000 stripping shared by skills and plugin manifests.

The plugin tests for invalid UTF-8 names and long paths no longer
assert on plugin skills, which the next change loads; they only run
on Linux, so local macOS runs missed it.

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

f0ssel commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 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-16T23:32:32.372480Z fe9eddc 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

Copy link
Copy Markdown

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

Reviewed commit: fe9eddc00d

ℹ️ 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 16, 2026 23:43
@f0ssel
f0ssel removed the request for review from hugodutka November 17, 2026 16:34
@f0ssel
f0ssel marked this pull request as draft November 19, 2026 14:46
@f0ssel
f0ssel removed the request for review from mafredri 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