CustomAgents - Ignores agents loaded from .github/agents folder
- 主要语言
- Java
- 星标
- 10.5k
- 派生
- 1.5k
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 128
描述
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
```cs
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:
```md
---
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.
贡献指南
调研方向
从 SessionConfig.CustomAgents 和 Agent.ListAsync 入口点开始,然后跟踪 EnableConfigDiscovery 为 true 时如何从 .github/agents 中发现 agents。使用自定义 agent 和 sample.agent.md 文件重现该示例,并验证生成的列表包含两个来源,同时保留文档中所述的 agent 行为。结合 Handoffs 和 SessionHandoffEvent 等 agent 属性,检查 CustomAgents 的处理方式。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- api, developer-experience
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100