💡 更多技术分享,欢迎访问我的博客:叁木の小屋
本篇概要
智能体定制和扩展性是本次更新的核心,让开发者能够塑造 AI 在代码库中的行为方式。主要更新包括:
/init命令自动生成工作区说明- Agent Skills 正式发布
- Claude Agent SDK 支持
- 智能体编排模式
一、智能体定制
1.1 /init 命令
一键生成针对项目的工作区说明:
/init
│
├─ 发现代有的 AI 约定(copilot-instructions.md、AGENTS.md)
├─ 分析项目结构
├─ 识别编码模式
└─ 生成定制的工作区说明
1.2 Agent Skills 正式发布
设置:chat.useAgentSkills、chat.agentSkillsLocations
| 功能 | 说明 |
|---|---|
| 默认启用 | 无需手动开启 |
| 技能文件夹 | .github/skills、.claude/skills |
| 用户技能 | ~/.copilot/skills、~/.claude/skills |
| 查看命令 | Chat: Configure Skills |
| 创建命令 | Chat: New Skill File |
扩展作者支持
在 package.json 中声明技能:
{
"contributes": {
"chatSkills": [
{
"path": "./skills/my-skill"
}
]
}
}
1.3 组织级说明
设置:github.copilot.chat.organizationInstructions.enabled
GitHub 组织级别的自定义说明,确保团队间指导一致。
1.4 自定义智能体文件位置
设置:chat.agentFilesLocations
{
"chat.agentFilesLocations": {
"~/.vscode/agents": true,
"shared/team-agents": true
}
}
1.5 智能体调用控制
Frontmatter 属性扩展:
| 属性 | 作用 |
|---|---|
user-invokable | 控制是否可从下拉菜单选择 |
disable-model-invocation | 防止被其他智能体调用 |
agents | 限制可调用的子智能体列表 |
示例:仅供子智能体调用的内部智能体
---
name: my-internal-agent
user-invokable: false
---
此智能体只能作为子智能体调用
示例:限制子智能体范围
---
name: Foo
tools: ['agent']
agents: ['Modify', 'Search']
---
此智能体只能使用 Modify 和 Search 子智能体。
1.6 多模型回退支持
---
name: my-agent
model: ['Claude Sonnet 4.5 (copilot)', 'GPT-5 (copilot)']
---
首选 Claude Sonnet 4.5,不可用时回退到 GPT-5。
1.7 聊天定制诊断
右键聊天视图 → Diagnostics,查看:
- 所有加载的自定义智能体
- 提示文件状态
- 说明文件状态
- 技能加载状态
- 加载错误信息
1.8 语言模型编辑器增强
| 功能 | 说明 |
|---|---|
| 多配置支持 | 同一提供程序多个 API Key |
| Azure 模型配置 | 自动插入代码段模板 |
| 提供程序组管理 | 配置或移除提供程序组 |
| 配置文件 | chatLanguageModels.json |
| 配置 UI | 提供程序可声明配置架构 |
二、智能体扩展性
2.1 智能体编排(Agent Orchestration)
多个专业智能体协作完成复杂任务的模式:
┌─────────────────────────────────────────────────────────┐
│ Conductor / 主智能体 │
├─────────────────────────────────────────────────────────┤
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Planning │ │ Research │ │Implement │ │ Review │ │
│ │ 规划 │ │ 研究 │ │ 实施 │ │ 审查 │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ ↓ ↓ ↓ ↓ │
│ 独立上下文窗口 独立上下文窗口 独立上下文窗口 独立上下文窗口│
└─────────────────────────────────────────────────────────┘
三大优势:
| 优势 | 说明 |
|---|---|
| 上下文效率 | 每个子智能体独立上下文,防止溢出 |
| 专业化 | 不同任务使用不同优化模型 |
| 并行执行 | 独立任务可同时进行 |
社区示例:
- Copilot Orchestra - 多智能体编排系统
- GitHub Copilot Atlas - 扩展编排系统(Prometheus、Oracle、Sisyphus、Explorer)
2.2 Claude Agent 支持(预览)
- 使用 GitHub Copilot 订阅中的 Claude 模型
- 采用 Anthropic 官方 Claude Agent harness
- 共享相同的提示、工具和架构
2.3 Anthropic 模型增强
| 功能 | 设置 | 说明 |
|---|---|---|
| Messages API 交错思考 | github.copilot.chat.anthropic.thinking.budgetTokens | Claude 在工具调用之间推理 |
| 工具搜索工具 | github.copilot.chat.anthropic.toolSearchTool.enabled | 从更大工具池中发现相关工具 |
| 上下文编辑 | github.copilot.chat.anthropic.contextEditing.enabled | 清除旧令牌,推迟总结 |
2.4 MCP Apps 支持
MCP Apps 允许服务器在客户端显示丰富的交互式 UI。
相关资源:
| 资源 | 链接 |
|---|---|
| 演示仓库 | github.com/modelcontextprotocol/servers |
| SDK 和示例 | github.com/modelcontextprotocol |
| VS Code 文档 | code.visualstudio.com |
| 开发指南 | modelcontextprotocol.io |
2.5 自定义注册表基础 URL
支持 registryBaseUrl 属性,可从私有或替代包注册表部署 MCP 服务器。
快速配置参考
配置技能位置
{
"chat.agentSkillsLocations": {
"~/.copilot/skills": true,
"~/.claude/skills": true,
"shared/team-skills": true
}
}
配置智能体文件位置
{
"chat.agentFilesLocations": {
"~/.vscode/agents": true,
"shared/team-agents": true
}
}
启用 Anthropic 增强
{
"github.copilot.chat.anthropic.thinking.budgetTokens": 10000,
"github.copilot.chat.anthropic.toolSearchTool.enabled": true,
"github.copilot.chat.anthropic.contextEditing.enabled": true
}
配置 Plan Agent 默认模型
{
"github.copilot.chat.implementAgent.model": "Claude Sonnet 4.5 (copilot)"
}
配置内联聊天默认模型
{
"inlineChat.defaultModel": "GPT-5 (copilot)"
}
下一篇预告
(三)智能体优化与安全 将深入探讨:
- Copilot Memory 跨会话记忆
- 非 GitHub 工作区外部索引
- 终端沙盒安全机制
- 自动审批规则