CustomAgents - Ignores agents loaded from .github/agents folder
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- csharp
- Domain
- api, developer-experience
Research direction
Start at SessionConfig.CustomAgents and the Agent.ListAsync entry point, then trace how agents are discovered from .github/agents when EnableConfigDiscovery is true. Reproduce the example with a custom agent and a sample.agent.md file, and verify that the resulting list includes both sources while preserving the documented agent behavior. Review the CustomAgents handling alongside agent properties such as Handoffs and SessionHandoffEvent.
Written by the indexing model from the issue text.
Description
When you set SessionConfig.CustomAgents all agents that would be otherwise loaded from the workspace .github/agent folder are ignored
This simple examples shows the behaviour
using GitHub.Copilot;
// path to .github folder containing agents folder
const string WorkingDirectory = @"C:\SomeWorkspace";
await using var client = new CopilotClient();
await using var session = await client.CreateSessionAsync(new SessionConfig
{
WorkingDirectory = WorkingDirectory,
EnableConfigDiscovery = true, // Note that this has to be true to get any agents to load from disk - (see https://github.com/github/copilot-sdk/issues/1887)
CustomAgents = [ // Remove this property and you'll see that all agents are loaded from the .github/agents folder
new() {
Name = "Custom"
}
]
});
var agentsList = await session.Rpc.Agent.ListAsync();
foreach (var agent in agentsList.Agents)
{
// You'll only see the "Custom" agent.
Console.WriteLine(agent.Name);
}
Agent file I was using in a .github/agents/sample.agent.md file:
---
name: sample
description: Sample Agent
---
You are an sample agent for this repository, you're just happy to be here!
The agent list isn't merged together like skills, instructions and MCPs are.
Additionally, are there any plans to bring the agents loaded in via the CustomAgents property into full parity with agents loaded from the .github/agents folder? It seems that not all properties are supported, like Handoffs, which means no SessionHandoffEvent can ever be raised and agent passing can only happen via sub-agents via the task tool.
- Dominant language
- Java
- Stars
- 10.5k
- Forks
- 1.5k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 133
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/copilot-sdk
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/copilot-sdk#2709 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
github/copilot-sdk#2673 ·
-
bug testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
github/copilot-sdk#2628 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/copilot-sdk#2627 · 1 comment ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
github/copilot-sdk#2493 ·
All issues in github/copilot-sdk
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/rocketmq-dashboard#4860 · 1 comment ·
-
agent-audit bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Vault-Web/cloud-page#144 ·