Introduction
You can start Copilot云代理 sessions from several places on GitHub. Once a session is running, you can monitor its progress, steer it with follow-up prompts, and iterate on the resulting pull request—all without leaving the browser.
For more information about Copilot云代理, see 关于 GitHub Copilot 云代理.
Starting a session from the agents tab or panel
You can start sessions from the agents tab and the agents panel. The only difference is the entry point—once you see the "New agent task" form, the steps are the same.
-
打开代理面板或选项卡:
- 在存储库中打开 Agents 选项卡。
- 导航到智能体页面****:转到 github.com/copilot/agents。 你也可以通过打开智能体面板,然后单击“View all”进入此页面****。
- 打开智能体面板****:单击 GitHub 右上角导航栏中的 。
-
使用提示字段中的下拉菜单,选择要使用的存储库 Copilot 。
-
键入描述请求的提示。 还可以通过粘贴、拖动或上传图像来添加视觉输入,例如屏幕截图或 UI 模型。 支持的文件:image/png、image/jpeg、image/gif、image/webp。
例如:
Implement a user friendly message for common errors.如果要 Copilot 打开拉取请求,可以在提示中提问,例如
Open a pull request to implement a user friendly message for common errors. -
(可选)为 Copilot 的变更选择基分支。 Copilot 将基于此分支创建新分支。
-
(可选)如果您想分配一个代理或一个具有专用行为和工具的,可以单击自定义智能体以打开代理下拉菜单。 可以从存储库、组织或企业中选择现有 自定义智能体。 还可以单击“创建代理”,在所选存储库和分支中创建新的代理资料代理。 有关详细信息,请参阅“为Copilot云代理创建自定义代理”。
注意
第三方代理可用于 GitHub Copilot Pro、GitHub Copilot Pro+、GitHub Copilot业务 和 GitHub Copilot Enterprise 计划。
-
(可选)可以使用下拉菜单来选择将使用的 Copilot 模型。 有关详细信息,请参阅“更改 GitHub Copilot 云代理的 AI 模型”。
-
单击 或按 Enter。
Copilot 将启动一个新会话,该会话将显示在提示框下面的列表中。 Copilot 将处理任务并推送任何代码更改。
在会话日志中,只需单击一次即可追踪 Copilot的工作并打开拉取请求。 有关详细信息,请参阅“[AUTOTITLE](/copilot/how-tos/use-copilot-agents/cloud-agent/track-copilot-sessions)”。
Starting a session from the dashboard
You can ask Copilot to start work from the prompt box in the dashboard. The dashboard is your personalized overview of your activity on GitHub, seen when you visit https://github.com while logged in.
-
Navigate to the dashboard at https://github.com.
-
Click the Task button.
-
Using the dropdown menu in the prompt field, select the repository you want Copilot to work in.
-
Type a prompt describing your request.
For example,
Implement a user friendly message for common errors.If you want Copilot to open a pull request, you can ask in your prompt, for example
Open a pull request to implement a user friendly message for common errors. -
Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch.
-
(可选)如果您想分配一个代理或一个具有专用行为和工具的,可以单击自定义智能体以打开代理下拉菜单。 可以从存储库、组织或企业中选择现有 自定义智能体。 还可以单击“创建代理”,在所选存储库和分支中创建新的代理资料代理。 有关详细信息,请参阅“为Copilot云代理创建自定义代理”。
注意
第三方代理可用于 GitHub Copilot Pro、GitHub Copilot Pro+、GitHub Copilot业务 和 GitHub Copilot Enterprise 计划。
-
Click Send now or press Return.
You will be taken to the agents tab, and Copilot will start a new session, which will appear in the "Recent sessions" list below the prompt box. Copilot will work on the task and push any code changes.
注意
If you have enabled the New Dashboard Experience in feature preview, the new session will appear in "Agent sessions" under the prompt box in your dashboard. For more information, see 个人仪表板.
Starting from Copilot Chat
-
Open GitHub Copilot 聊天功能 on GitHub.com.
-
Type
/taskto ask Copilot to create a pull request, and give details of what you want Copilot to change.For example,
/task Create a pull request to put backticks around file names and variables in output. -
Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch, then push the changes to a pull request targeting that branch.
-
(可选)如果您想分配一个代理或一个具有专用行为和工具的,可以单击自定义智能体以打开代理下拉菜单。 可以从存储库、组织或企业中选择现有 自定义智能体。 还可以单击“创建代理”,在所选存储库和分支中创建新的代理资料代理。 有关详细信息,请参阅“为Copilot云代理创建自定义代理”。
注意
第三方代理可用于 GitHub Copilot Pro、GitHub Copilot Pro+、GitHub Copilot业务 和 GitHub Copilot Enterprise 计划。
-
Click or press Enter.
Copilot will start a new session, which will appear in the list below the prompt box. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.
Assigning an issue to Copilot
You can ask Copilot to start working on an issue by assigning the issue to Copilot. Copilot will start working on the task, raise a pull request, then request a review from you when it's finished.
注意
This feature is in 公开预览 and subject to change.
-
在 GitHub 上,导航到存储库的主页面。
-
在仓库名称下,单击 “Issues”****。

-
Open the issue that you want to assign to Copilot.
-
In the right side menu, click Assignees.

-
Click Copilot from assignees list.

Additional options are displayed.

-
In the Optional prompt field you can add specific guidance for Copilot. Add any context, constraints, or specific requirements that will help Copilot to understand and complete the task.
For example, you might include instructions about specific coding patterns or frameworks to use, testing requirements, code style preferences, files or directories that should or shouldn't be modified.
In addition to the details you supply here, Copilot will use any custom instructions that have been configured for the target repository. See 为GitHub Copilot添加存储库自定义说明.
-
You can use the dropdown menus in the dialog to change the repository that Copilot will work in and the branch that it will branch off from.
All repositories where you have at least read access will be displayed in the repository dropdown menu. However, you can only select a repository if you have write access to it, and if Copilot云代理 is enabled for that repository.
If you select a repository in a different organization than the issue's source organization, or if you select a public repository when the issue is in a private repository, a warning will be displayed.
If you don't specify a repository, Copilot will work in the same repository as the issue. If you don't specify a branch, Copilot will work from the default branch of the selected repository.
提示
When you assign an issue to Copilot, it gets sent the issue title, description, any comments that currently exist, and any additional instructions you provide. After assigning the issue, Copilot will not be aware of, and therefore won't react to, any further comments that are added to the issue. If you have more information, or changes to the original requirement, add this as a comment in the pull request that Copilot raises.
-
(可选)如果您想分配一个代理或一个具有专用行为和工具的,可以单击自定义智能体以打开代理下拉菜单。 可以从存储库、组织或企业中选择现有 自定义智能体。 还可以单击“创建代理”,在所选存储库和分支中创建新的代理资料代理。 有关详细信息,请参阅“为Copilot云代理创建自定义代理”。
注意
第三方代理可用于 GitHub Copilot Pro、GitHub Copilot Pro+、GitHub Copilot业务 和 GitHub Copilot Enterprise 计划。
-
(可选)可以使用下拉菜单来选择将使用的 Copilot 模型。 有关详细信息,请参阅“更改 GitHub Copilot 云代理的 AI 模型”。
You can also assign issues to Copilot from other places on GitHub.com:
- From the list of issues on a repository's Issues page.
- When viewing an issue in GitHub 项目.
Seeding a new repository
When creating a new repository, you can ask Copilot to seed the new repository by entering a prompt.
-
在任何页面的右上角,选择 ,然后单击“新建存储库”。

-
使用“所有者”下拉菜单选择你想要拥有存储库的帐户。

-
In the Prompt field, enter a prompt describing what you want Copilot to build.
For example,
Create a Rust CLI for converting CSV spreadsheets to Markdown -
单击“创建存储库”。
Copilot will immediately open a draft pull request. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.
Fixing a failing GitHub Actions workflow run
注意
This feature is only available to Copilot业务 and Copilot Enterprise users.
When an GitHub Actions workflow run fails on a pull request branch, you can ask Copilot to investigate and fix the failure.
-
On GitHub, navigate to the failing workflow run job page.
-
Click the Fix with Copilot button.
Copilot will start a new session, investigate the cause of the failure, and push a fix to your branch.
Continuing work on a pull request
You can mention @copilot in a comment on any pull request to ask Copilot to make changes. This works on pull requests created by Copilot and on pull requests you or others created.
By default, Copilot pushes commits directly to the pull request branch. To create a separate pull request instead, describe that in your comment. You can also check out the branch and push changes yourself.
Batch review comments instead of submitting them individually. When submitting a pull request comment (not a review or review comment) through the GitHub web interface, select a model with the model picker. Copilot uses the model from the original pull request by default.
Copilot 仅响应对存储库具有写入权限的人的评论。
When Copilot starts a new session in response to your comment, an eyes emoji (👀) reaction appears on the comment. A "Copilot has started work" event appears in the pull request timeline.

Copilot remembers context from previous sessions on the same pull request, so follow-up requests are faster and more reliable. If the pull request was created by a 自定义智能体, mentioning @copilot continues using that same agent.
Resolving merge conflicts
You can ask Copilot to resolve merge conflicts on a pull request in two ways:
- Using the "Fix with Copilot" button: If a pull request has merge conflicts, click the Fix with Copilot button that appears in the merge box.
- Using an @copilot mention: Mention
@copilotin a comment on the pull request and ask it to fix the conflicts—for example, "@copilot resolve the merge conflicts on this PR."
Copilot analyzes the conflicting changes, resolves them, and verifies that the build, tests, and linter still pass. It then requests your review so you can confirm the resolution before merging.
Managing GitHub Actions workflow runs
默认情况下,当 GitHub Actions 向拉取请求推送更改时,Copilot 工作流不会自动运行。
GitHub Actions 工作流可以具有特权,并且有权访问敏感机密。 检查拉取请求中的拟议更改,确保您在拉取请求分支上自由运行您的工作流程。 应特别注意 .github/workflows/ 目录中影响工作流文件的任何拟议更改。
若要允许 GitHub Actions 工作流运行,请单击拉取请求合并框中的 “批准并运行工作流 ”按钮。

(可选)你可以配置为 Copilot云代理 允许 GitHub Actions 工作流在没有人工干预的情况下运行。 For more information, see 配置 GitHub Copilot 云代理的设置.
Giving feedback on Copilot's work
Use the feedback buttons on Copilot's pull requests and comments to rate the output. Your feedback helps improve Copilot's quality.
- On a pull request or comment from Copilot, click the thumbs up (👍) or thumbs down (👎) button.
- If you click the thumbs down button, optionally select a reason and leave a comment, then click Submit feedback.