{"meta":{"title":"GitHub Copilot云代理故障排除","intro":"了解如何解决将任务分配到Copilot时可能出现的问题。","product":"GitHub Copilot","breadcrumbs":[{"href":"/zh/copilot","title":"GitHub Copilot"},{"href":"/zh/copilot/how-tos","title":"操作方法"},{"href":"/zh/copilot/how-tos/use-copilot-agents","title":"使用Copilot代理"},{"href":"/zh/copilot/how-tos/use-copilot-agents/cloud-agent","title":"Cloud agent"},{"href":"/zh/copilot/how-tos/use-copilot-agents/cloud-agent/troubleshoot-cloud-agent","title":"排查云代理问题"}],"documentType":"article"},"body":"# GitHub Copilot云代理故障排除\n\n了解如何解决将任务分配到Copilot时可能出现的问题。\n\n## Copilot 在我的问题上的“被分配者”列表中不可用\n\n只有在通过付费 Copilot 计划获得对 Copilot 的访问权限时，你才能将问题分配给 Copilot。\n\n如果还没有其中一个计划的订阅，请单击此按钮了解详细信息：<br>\n\n<a href=\"https://github.com/features/copilot/plans?ref_product=copilot&ref_type=engagement&ref_style=button\" target=\"_blank\" class=\"btn btn-primary mt-3 mr-3 no-underline\">\n<span>注册 Copilot</span><svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-link-external\" aria-label=\"link external icon\" role=\"img\"><path d=\"M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z\"></path></svg></a>\n\n\\_如果您确实\\_使用的是付费Copilot计划，请检查Copilot cloud agent未被针对该仓库手动禁用：\n\n* 对于组织拥有的 Copilot cloud agent 存储库，存储库中的可用性由组织和/或企业管理员管理。 请参阅“[将GitHub Copilot云代理添加到组织](/zh/enterprise-cloud@latest/copilot/how-tos/administer-copilot/manage-for-organization/add-copilot-cloud-agent)”。\n\n* 对于个人存储库，Copilot cloud agent 的可用性是在您的帐户设置中配置的。 请参阅“[以个人订阅者身份管理 GitHub Copilot 策略](/zh/copilot/how-tos/manage-your-account/manage-policies#disabling-or-enabling-copilot-cloud-agent-in-your-repositories)”。\n\n> \\[!NOTE]\n> 可以在 Copilot cloud agent 设置的功能页面中检查是否为你启用了 Copilot：[github.com/settings/copilot/features](https://github.com/settings/copilot/features)。\n\n## 我有一个 Enterprise Managed User 帐户，而 Copilot 无法在我的个人存储库中工作\n\nCopilot cloud agent 不在由 托管用户帐户 拥有的个人存储库中可用。 这是因为 Copilot cloud agent 运行在 GitHub 托管的运行程序上，而这些托管的运行程序对 托管用户帐户 拥有的个人存储库不可用。 有关详细信息，请参阅“[GitHub 托管的运行程序](/zh/actions/concepts/runners/github-hosted-runners)”。\n\n<!--If you update this text, you may also need to update \"Limitations in Copilot's compatibility with other features\" in https://docs.github.com/en/copilot/using-github-copilot/cloud-agent/about-assigning-tasks-to-copilot  -->\n\n如果你有一个 托管用户帐户，并尝试将 Copilot 分配到个人存储库中的一个问题，你可能会看到一条错误消息，报告 GitHub Actions 不适用于你的存储库。\n\n若要使用 Copilot cloud agent，需要使用组织拥有的存储库，而不是个人存储库。\n\n## <c0 /> 无法从 <c1 /> 创建拉取请求\n\n如果你要求 Copilot 创建拉取请求，而其回应无法直接创建拉取请求，请检查 Copilot cloud agent 是否可用。\n\n> \\[!IMPORTANT]\n> 在VS Code、Visual Studio和JetBrains IDE中，必须在提示中提及`@github`聊天参与者。 可以在Copilot Chat中的GitHub.com省略此项。\n\n## 我将一个任务分配给Copilot，但一直没有进展。\n\n请稍等片刻，然后刷新页面。 你应该会看到 Copilot 对问题做出 👀 回复。 在此之后不久，Copilot 将打开一个与问题链接的拉取请求草稿，该草稿将显示在问题时间表中。\n\n## Copilot 已打开拉取请求，但未发生任何操作\n\n如果在拉取请求时间线中有“Copilot 已启动的工作”事件，请单击“ **查看会话** ”以查看会话日志。 这些内容将实时流式传输，你将能够看到 Copilot 正在执行的操作。\n\n## Copilot 不会响应我的拉取请求注释\n\nCopilot 仅响应对存储库具有写入权限的人的评论。\n\n如果您确实具有写入访问权限，并且在分配给 `@copilot` 的拉取请求中提到 Copilot，则评论将传递给 Copilot cloud agent。 将眼睛表情符号 （👀） 添加到批注中，以指示 Copilot cloud agent 已看到您的评论。 不久之后，将 \"Copilot 开始工作\" 事件添加到拉取请求时间线上。\n\n如果没有发生这种情况，则 Copilot 可能已从拉取请求中取消分配，或者你可能没有写入访问权限。 请注意，Copilot 仅对打开拉取请求中的提及做出响应。 一旦 Pull Request 被合并或关闭，Copilot cloud agent 将不再回应新的提及或注释，以便更好地专注于开发工作。\n\n## 根据代理会话日志， Copilot 似乎停滞不前\n\nCopilot 可能会出现卡住一段时间，然后再次移动。\n\n如果会话仍然卡住，则会在一小时后超时。 可以通过取消分配问题，然后将其重新分配到 Copilot 来重试。\n\n如果在 Copilot 响应批注时遇到问题，请尝试再次向拉取请求添加相同的批注。\n\n## 当 Copilot 发起推送时，我的 GitHub Actions 工作流未运行\n\nGitHub Actions 将更改推送到拉取请求时，Copilot 工作流不会自动运行。\n\n若要允许 GitHub Actions 工作流运行，请单击拉取请求合并框中的 **“批准并运行工作流** ”按钮。 请参阅“[查看来自 Copilot 的输出](/zh/copilot/how-tos/copilot-on-github/use-copilot-agents/review-copilot-output)”。\n\n## Copilot 正在推送未通过 CI 检查的更改\n\n在处理问题时，Copilot 可以访问自己的临时开发环境，该环境由 GitHub Actions 提供支持，它可以在其中执行自动化测试和 linter，以在推送之前验证其工作。\n\n如果有明确的说明要做什么，那么就很可能会做到这一点。 执行此操作的最佳方法是使用 `.github/copilot-instructions.md` 文件。 请参阅“[使用GitHub Copilot处理任务的最佳做法](/zh/copilot/tutorials/cloud-agent/get-the-best-results#adding-custom-instructions-to-your-repository)”。\n\n## GitHub Copilot发出了有关防火墙的警告\n\n默认情况下， Copilot对 Internet 的访问受防火墙限制。\n\n限制对 Internet 的访问有助于管理数据外泄风险，其中 Copilot 的异常行为或其收到的恶意指令可能导致代码或其他敏感信息泄露到远程位置。\n\n如果 Copilot 尝试发出防火墙阻止的请求，则会将警告添加到拉取请求正文（如果 Copilot 正在响应问题分配）或注释（如果 Copilot 正在响应批注）。 警告会显示受阻止的地址和试图发出请求的命令。\n\n![该屏幕截图显示了来自 Copilot 的关于受防火墙阻止的警告。](/assets/images/help/copilot/cloud-agent/firewall-warning.png)\n\n有关详细信息，请参阅“[自定义或禁用GitHub Copilot的防火墙](/zh/copilot/how-tos/copilot-on-github/customize-copilot/customize-the-firewall)”。\n\n## Copilot 未获取附加的屏幕截图\n\n允许 Copilot cloud agent 的最大图像大小为 3.00 MiB。 系统将从请求中删除大于此大小的图像。\n\n## 延伸阅读\n\n* [使用GitHub Copilot处理任务的最佳做法](/zh/copilot/tutorials/cloud-agent/get-the-best-results)\n* [配置开发环境](/zh/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/customize-the-agent-environment)"}