feat: support plugin-contributed custom agents - #2365
Merged
Conversation
🦋 Changeset detectedLatest commit: e927dcb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
# Conflicts: # docs/en/customization/plugins.md # docs/zh/customization/plugins.md # packages/agent-core-v2/docs/state-manifest.d.ts # packages/agent-core-v2/test/app/plugin/manifest.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
No linked issue — the problem is explained below.
Problem
Plugins can ship skills, slash commands, MCP servers, and hooks, but there is no way for a plugin to provide custom agents. A team distributing a workflow as a plugin cannot bundle purpose-built sub-agents with it; users have to copy agent files into their user- or project-level agent directories by hand.
What changed
Plugins can now contribute custom agents on both engines:
agentsfield: one or more./paths that must resolve to directories inside the plugin root (same validation asskills). When the field is omitted, anagents/directory at the plugin root is picked up automatically, mirroring the rootSKILL.mdfallback.--agent-file), so any locally defined agent shadows a plugin-provided one, and replacing a built-in agent still requiresoverride: truein the frontmatter.agent-core):SessionAgentProfileCatalogacceptspluginRoots, wired through RPC session creation and theSessionfallback catalog config; the catalog is rebuilt on new sessions and/reload.agent-core-v2): new Session-scopePluginAgentProfileSourcemirroringPluginSkillSource, merged by the session agent-profile catalog and refreshed on/plugins reloadviaplugin.onDidReload.pluginManifestSchema) exposes the newagentsfield so the v1↔v2 plugin parity holds.plugins.md(manifest field table + a "Plugin Agents" section) andagents.md(discovery scope order is now Explicit > Project > Extra > User > Plugin > Built-in), in both English and Chinese.This approach reuses the existing agent-file discovery and priority-merge machinery instead of adding a parallel registration path, so plugin agents behave exactly like agents from any other directory scope.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.