Draft
Conversation
- Create custom_agents module in core for discovering agent .md files from $CODEX_HOME/agents/ - Add CustomAgent struct in protocol with frontmatter support (description, model, sandbox) - Add ListCustomAgents operation and ListCustomAgentsResponse event - Implement list_custom_agents handler in codex.rs - Add tests for agent discovery and frontmatter parsing - Update rollout policy to handle new event type Co-authored-by: x22x22 <3389949+x22x22@users.noreply.github.com>
- Create CustomAgentTask to run custom agents as subagents - Add RunCustomAgent operation to protocol - Implement run_custom_agent handler in codex.rs - Add Custom task kind to TaskKind enum - Custom agents run with their own instructions, model, and sandbox policy - Forward all events from custom agent to parent session Co-authored-by: x22x22 <3389949+x22x22@users.noreply.github.com>
- Create comprehensive custom-agents.md documentation - Add four example custom agents: - code-reviewer: Code review specialist - documentation-writer: Technical documentation expert - test-engineer: Test automation specialist - security-auditor: Security vulnerability assessor - Add examples README with usage instructions - Document frontmatter configuration options - Include best practices and troubleshooting guide Co-authored-by: x22x22 <3389949+x22x22@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance project to support subagent customization via md files
Add custom subagent support via markdown files
Dec 16, 2025
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.
Enables users to define specialized subagents through markdown files in
$CODEX_HOME/agents/. Each agent runs as an isolated subagent with custom instructions, model selection, and sandbox policies.Implementation
Core Infrastructure
custom_agents.rs: Agent discovery from filesystem, frontmatter parsing (description, model, sandbox)CustomAgentTask: Executes agents viarun_codex_conversation_one_shotwith modified configListCustomAgentsop,RunCustomAgentop with agent name + input itemsConfiguration via Frontmatter
Usage
Security
read-only(default),workspace-write,danger-full-accessDocumentation
docs/custom-agents.md: Feature documentation, best practices, troubleshootingdocs/examples/custom-agents/: Four working examples (code-reviewer, documentation-writer, test-engineer, security-auditor)Architecture
Follows existing subagent pattern (ReviewTask, CompactTask):
$CODEX_HOME/agents/{name}.mdbase_instructions,model,sandbox_policyAgent names derived from filename stems. Only
.mdfiles discovered. Subdirectories not scanned.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.