Hinweis
Copilot-Programmier-Agent is in public preview and subject to change.
You can assign a issue to Copilot, just like you would with a human software developer. Copilot will start working on the issue, raise a pull request and when it's finished working, request a review from you. For more information, see Informationen zum Zuweisen von Aufgaben zu Copilot.
If you haven't used Copilot to work on an issue before, you can find some useful advice for getting good results in Best practices for using Copilot to work on tasks.
You can ask Copilot to start working on an issue by assigning the issue to Copilot.
You can assign an issue to Copilot:
- On .com (see the next section)
- On Mobile
- Via the API (see later in this article)
- Using CLI (see
gh issue edit
)
You can assign an issue to Copilot on .com in exactly the same way as you assign another user.
Navigieren Sie auf zur Hauptseite des Repositorys.
Klicke unter dem Namen deines Repositorys auf -Issues.
Open the issue that you want to assign to Copilot.
In the right side menu, click Assignees.
Click Copilot from assignees list.
Tipp
When you assign an issue to Copilot, it gets sent the issue title, description, and any comments that currently exist. 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.
You can also assign issues to Copilot from other places on .com:
- From the list of issues on a repository's Issues page.
- When viewing an issue in Projekte.
You can assign an issue to Copilot by making a request to the GraphQL API.
Make sure you're authenticating with the API using a user token, for example a personal access token or a App user-to-server token.
Verify that Copilot-Programmier-Agent is enabled in the repository by checking if the repository's
suggestedActors
in the GraphQL API includes Copilot. Replacemonalisa
with the repository owner, andoctocat
with the name.GraphQL query { repository(owner: "monalisa", name: "octocat") { suggestedActors(capabilities: [CAN_BE_ASSIGNED], first: 100) { nodes { login __typename ... on Bot { id } ... on User { id } } } } }
query { repository(owner: "monalisa", name: "octocat") { suggestedActors(capabilities: [CAN_BE_ASSIGNED], first: 100) { nodes { login __typename ... on Bot { id } ... on User { id } } } } }
If Copilot-Programmier-Agent is enabled for the user and in the repository, the first node returned from the query will have the
login
valuecopilot-swe-agent
.Fetch the GraphQL global ID of the issue you want to assign to Copilot, replacing
monalisa
with the repository owner,octocat
with the name and9000
with the issue number.GraphQL query { repository(owner: "monalisa", name: "octocat") { issue(number: 9000) { id title } } }
query { repository(owner: "monalisa", name: "octocat") { issue(number: 9000) { id title } } }
Assign the issue to Copilot using the
replaceActorsForAssignable
GraphQL mutation. ReplaceISSUE_ID
with the ID returned from the previous step, andBOT_ID
with the ID returned from the step before that.GraphQL mutation { replaceActorsForAssignable(input: {assignableId: "ISSUE_ID", assigneeIds: ["BOT_ID"]}) { assignable { ... on Issue { id title assignees(first: 10) { nodes { login } } } } } }
mutation { replaceActorsForAssignable(input: {assignableId: "ISSUE_ID", assigneeIds: ["BOT_ID"]}) { assignable { ... on Issue { id title assignees(first: 10) { nodes { login } } } } } }
Shortly after you assign an issue to Copilot, Copilot will leave an 👀 reaction on the issue.
A few seconds later, Copilot will open a draft pull request, linked to your original issue. An event will appear in the issue's timeline, linking to the pull request.
Copilot will start an agent session to work on your issue. A "Copilot started work" event will appear in the pull request timeline, and as Copilot works, it will update the pull request body with regular status updates, and push commits to the branch.
If you want to check what Copilot is doing, click View session. The session log viewer is displayed, showing you a live log as Copilot works on the issue. If you want to stop Copilot from working on the issue, click Stop session. See Verwenden der Protokolle des Copilot-Programmier-Agents.
Once Copilot has finished, the agent session will end, and Copilot will request a review from you, triggering a notification. In addition, a "Copilot finished work" event will appear in the pull request timeline.
After Copilot has finished working on the issue, you should review the pull request thoroughly and comment on anything that needs changed. See Überprüfen eines von Copilot erstellten Pull Requests.