Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions content/copilot/concepts/agents/code-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,37 @@ If you include these file types in a pull request, {% data variables.copilot.cop

For more information, see [AUTOTITLE](/copilot/reference/review-excluded-files).

## {% data variables.copilot.copilot_code-review-tools-preview_cap %}
## {% data variables.copilot.copilot_code-review-tools_cap_short %}

> [!NOTE]
>
> * The [AUTOTITLE](/free-pro-team@latest/site-policy/github-terms/github-pre-release-license-terms) apply to your use of this product.
> * The [AUTOTITLE](/free-pro-team@latest/site-policy/github-terms/github-pre-release-license-terms) apply to your use of preview features.
> * {% data variables.copilot.copilot_code-review_short %} has several new tools that are in {% data variables.release-phases.public_preview %} and subject to change.

If you get a {% data variables.product.prodname_copilot_short %} subscription from an organization, you can only participate in the {% data variables.release-phases.public_preview %} on the {% data variables.product.github %} website if an owner of your organization or enterprise has enabled using preview features. See [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization) and [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-enterprise-policies).
{% data variables.copilot.copilot_code-review_short %} uses full project context gathering to provide more specific, accurate, and contextually aware code reviews. This capability analyzes your entire repository to better understand the context of code changes. Full project context gathering is generally available and enabled automatically for {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} plans.

These new tools are enabled automatically for {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} plans.
{% data variables.copilot.copilot_code-review_short %} includes additional new tools that are in {% data variables.release-phases.public_preview %}:

* **Full project context gathering**. This provides more specific, accurate, and contextually aware code reviews.
* **Support for static analysis tools like {% data variables.product.prodname_codeql %}, ESLint, and PMD**. This delivers more high-signal, consistent findings for security and quality.
* **The ability to pass suggestions to {% data variables.copilot.copilot_coding_agent %}**. This automates creation of a new pull request against your branch with the suggested fixes applied.

These tools are also enabled automatically for {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} plans.

If you get a {% data variables.product.prodname_copilot_short %} subscription from an organization, you can only participate in the {% data variables.release-phases.public_preview %} on the {% data variables.product.github %} website if an owner of your organization or enterprise has enabled using preview features. See [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization) and [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-enterprise-policies).

You do not need to have {% data variables.product.prodname_code_scanning %} and {% data variables.product.prodname_actions %} enabled in your organization or enterprise to use the {% data variables.copilot.copilot_code-review-tools_short %}.

If {% data variables.product.prodname_actions %} is unavailable or if Actions workflows used by {% data variables.copilot.copilot_code-review_short %} fail, reviews will still be generated. However, they will not include the additional features provided by the {% data variables.copilot.copilot_code-review-tools_short %}.

> [!NOTE]
>
> The {% data variables.release-phases.public_preview %} includes free actions minutes for the {% data variables.copilot.copilot_code-review-tools_short %}.
>
> Usage charges will apply when the feature becomes generally available.
> The {% data variables.release-phases.public_preview %} includes free actions minutes for the new {% data variables.copilot.copilot_code-review-tools_short %}.

## Usage of {% data variables.product.prodname_actions %} runners for tools in code review

{% data reusables.copilot.code-review.code-review-actions-usage %}

Organizations in this situation can use self-hosted runners. For more information, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/request-a-code-review/configure-self-hosted-runners).

## Code review monthly quota

Expand Down
2 changes: 1 addition & 1 deletion content/copilot/get-started/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ A command line interface that lets you use {% data variables.product.prodname_co

AI-generated code review suggestions to help you write better code. See [AUTOTITLE](/copilot/using-github-copilot/code-review/using-copilot-code-review).

{% data variables.copilot.copilot_code-review-tools_cap_short %} is in {% data variables.release-phases.public_preview %} and subject to change. See [AUTOTITLE](/copilot/concepts/agents/code-review).
Several {% data variables.copilot.copilot_code-review-tools_short %} are in {% data variables.release-phases.public_preview %} and subject to change. See [AUTOTITLE](/copilot/concepts/agents/code-review).

### {% data variables.copilot.copilot_for_prs %}

Expand Down
10 changes: 10 additions & 0 deletions content/copilot/how-tos/copilot-sdk/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: GitHub Copilot SDK
shortTitle: Copilot SDK
intro: Learn how to customize your {% data variables.product.prodname_copilot_short %} experience using {% data variables.copilot.copilot_sdk_short %}.
versions:
feature: copilot
children:
- /sdk-getting-started
contentType: how-tos
---
150 changes: 150 additions & 0 deletions content/copilot/how-tos/copilot-sdk/sdk-getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
---
title: Getting started with Copilot SDK
shortTitle: Quickstart
intro: 'Learn how to install {% data variables.copilot.copilot_sdk_short %} and send your first message.'
allowTitleToDifferFromFilename: true
product: '{% data reusables.gated-features.copilot-sdk %}'
versions:
feature: copilot
topics:
- Copilot
contentType: get-started
category:
- Learn about Copilot
- Author and optimize with Copilot
---

> [!NOTE]
>{% data variables.copilot.copilot_sdk_short %} is currently in {% data variables.release-phases.technical_preview %}. Functionality and availability are subject to change.

{% data variables.copilot.copilot_sdk %} lets you build applications powered by {% data variables.product.prodname_copilot %} in your preferred programming language. In this guide, you'll install the SDK using `npm`, send your first message, and add streaming responses.

For more information and steps for other languages, see [Install the SDK](https://github.com/github/copilot-sdk/blob/main/docs/getting-started.md) in the `github/copilot-sdk` repository.

## Prerequisites

Before you begin, make sure you have **Node.js 18** or later installed.

## Authentication

Follow the instructions at [AUTOTITLE](/copilot/how-tos/copilot-cli/install-copilot-cli) to install and authenticate with {% data variables.copilot.copilot_cli %}. This will allow the SDK to access your {% data variables.product.github %} account and use {% data variables.product.prodname_copilot_short %}.

1. Verify that {% data variables.copilot.copilot_cli_short %} is installed and working:

```bash copy
copilot --version
```

## Installation

1. Create a new directory and initialize your project:

```bash copy
mkdir copilot-demo && cd copilot-demo
npm init -y --init-type module
```

1. Install the SDK and TypeScript runner:

```bash copy
npm install @github/copilot-sdk tsx
```

## Send your first message

1. Create a new file `index.ts` and add the following code. This sends a single prompt to {% data variables.product.prodname_copilot_short %} and prints the response.

```typescript copy
import { CopilotClient } from "@github/copilot-sdk";

const client = new CopilotClient();
const session = await client.createSession({ model: "gpt-4.1" });

const response = await session.sendAndWait({ prompt: "What is 2 + 2?" });
console.log(response?.data.content);

await client.stop();
process.exit(0);
```

1. Run the code:

```bash copy
npx tsx index.ts
```

In this example:

* **`CopilotClient()`** creates a new client that manages the connection to {% data variables.copilot.copilot_cli_short %}.
* **`createSession()`** starts a new conversation session with the specified model.
* **`sendAndWait()`** sends a prompt and waits for the complete response before returning.

## Add streaming responses

Instead of waiting for the full response, you can stream it as it's generated. This is useful for long responses or interactive applications where you want to display output in real time.

1. Update `index.ts` with the following code to listen and print response chunks as they arrive:

```typescript copy
import { CopilotClient } from "@github/copilot-sdk";

const client = new CopilotClient();
const session = await client.createSession({
model: "gpt-4.1",
streaming: true,
});

// Listen for response chunks
session.on("assistant.message_delta", (event) => {
process.stdout.write(event.data.deltaContent);
});
session.on("session.idle", () => {
console.log(); // New line when done
});

await session.sendAndWait({ prompt: "Tell me a short joke" });

await client.stop();
process.exit(0);
```

1. Run the code:

```bash copy
npx tsx index.ts
```

With streaming enabled, the response appears incrementally as it's generated.
You can subscribe to events to process each chunk in real time:

* **`assistant.message_delta`** fires for each chunk of the response as it's generated.
* **`session.idle`** fires when the response is complete and the session is ready for the next message.

### Event subscription methods

The SDK provides the following methods to subscribe to events:

* **on(handler)**: Subscribe to all events. Returns the unsubscribe function.
* **on(eventType, handler)**: Subscribe to a specific event type. Returns the unsubscribe function.

Add the following code to `index.ts` to subscribe to events and unsubscribe when you no longer need them:

```typescript copy
// Subscribe to all events
const unsubscribeAll = session.on((event) => {
console.log("Event:", event.type);
});

// Subscribe to specific event type
const unsubscribeIdle = session.on("session.idle", (event) => {
console.log("Session is idle");
});

// Later, to unsubscribe:
unsubscribeAll();
unsubscribeIdle();
```

## Next steps

To continue getting started with {% data variables.copilot.copilot_sdk_short %}, see [Build Your First Copilot-Powered App](https://github.com/github/copilot-sdk/blob/main/docs/getting-started.md#step-4-add-a-custom-tool) in the `github/copilot-sdk` repository.
1 change: 1 addition & 0 deletions content/copilot/how-tos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ children:
- /get-code-suggestions
- /chat-with-copilot
- /copilot-cli
- /copilot-sdk
- /use-copilot-agents
- /use-ai-models
- /provide-context
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Configuring self-hosted runners for GitHub Copilot code review
shortTitle: Configure self-hosted runners
intro: 'Learn how to configure self-hosted runners for {% data variables.copilot.copilot_code-review_short %}.'
allowTitleToDifferFromFilename: true
versions:
feature: copilot
topics:
- Copilot
contentType: how-tos
category:
- Author and optimize with Copilot
---

## About {% data variables.product.prodname_actions %} usage for code review tools

{% data reusables.copilot.code-review.code-review-actions-usage %} Organizations in this situation can use self-hosted runners.

## Configuring self-hosted runners for code review

You can run {% data variables.copilot.copilot_code-review_short %} using self-hosted {% data variables.product.prodname_actions %} runners with ARC (Actions Runner Controller). You must first set up ARC-managed scale sets in your environment. For more information on ARC, see [AUTOTITLE](/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/about-actions-runner-controller).

> [!WARNING]
> ARC is the only officially supported solution for self-hosting {% data variables.copilot.copilot_code-review_short %}. For security reasons, we do not recommend using non-ARC self-hosted runners.

> [!NOTE]
> {% data variables.copilot.copilot_code-review_short %} is only compatible with Ubuntu x64 Linux runners. Runners with Windows, macOS or other operating systems are not supported.

To configure self-hosted runners for {% data variables.copilot.copilot_code-review_short %}:

1. Configure network security controls for your {% data variables.product.prodname_actions %} runners to ensure that {% data variables.copilot.copilot_code-review_short %} does not have open access to your network or the public internet.

You must configure your firewall to allow connections to the [standard hosts required for {% data variables.product.prodname_actions %} self-hosted runners](/actions/reference/runners/self-hosted-runners#accessible-domains-by-function), plus the following hosts:

* `api.githubcopilot.com`
* `uploads.github.com`
* `user-images.githubusercontent.com`
1. In your `copilot-setup-steps.yml` file, set the `runs-on` attribute to your ARC-managed scale set name. For more information, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-dependencies-in-copilots-environment).

```yaml
# ...

jobs:
copilot-setup-steps:
runs-on: arc-scale-set-name
# ...
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ topics:
children:
- /use-code-review
- /configure-automatic-review
- /configure-self-hosted-runners
redirect_from:
- /copilot/using-github-copilot/code-review
- /copilot/how-tos/agents/copilot-code-review
Expand Down
3 changes: 2 additions & 1 deletion content/copilot/reference/ai-models/model-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ Used for:
* {% data variables.copilot.copilot_gemini_25_pro %}
* {% data variables.copilot.copilot_gemini_3_pro %}
* {% data variables.copilot.copilot_gemini_3_flash %}
* {% data variables.copilot.copilot_gemini_31_pro %}

{% data variables.product.prodname_copilot %} uses {% data variables.copilot.copilot_gemini_3_pro %}, {% data variables.copilot.copilot_gemini_3_flash %}, and {% data variables.copilot.copilot_gemini_25_pro %} hosted on Google Cloud Platform (GCP). When using {% data variables.copilot.copilot_gemini %} models, prompts and metadata are sent to GCP, which makes the [following data commitment](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance): _{% data variables.copilot.copilot_gemini %} doesn't use your prompts, or its responses, as data to train its models._
{% data variables.product.prodname_copilot %} uses {% data variables.copilot.copilot_gemini_31_pro %}, {% data variables.copilot.copilot_gemini_3_pro %}, {% data variables.copilot.copilot_gemini_3_flash %}, and {% data variables.copilot.copilot_gemini_25_pro %} hosted on Google Cloud Platform (GCP). When using {% data variables.copilot.copilot_gemini %} models, prompts and metadata are sent to GCP, which makes the [following data commitment](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance): _{% data variables.copilot.copilot_gemini %} doesn't use your prompts, or its responses, as data to train its models._

To provide better service quality and reduce latency, {% data variables.product.github %} uses [prompt caching](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance#customer_data_retention_and_achieving_zero_data_retention).

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% data variables.copilot.copilot_code-review_short %} uses {% data variables.product.prodname_actions %} to run the {% data variables.copilot.copilot_code-review-tools_short %}, including full project context gathering and the additional tools in {% data variables.release-phases.public_preview %}. By default, {% data variables.copilot.copilot_code-review_short %} uses {% data variables.product.prodname_dotcom %}-hosted runners.

If your organization has disabled {% data variables.product.prodname_dotcom %}-hosted runners, the new {% data variables.copilot.copilot_code-review-tools_short %} will not be available. In this case, code reviews will fall back to a more limited review.
2 changes: 1 addition & 1 deletion data/reusables/copilot/code-review/preview-note.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* {% data variables.copilot.copilot_code-review-tools_cap_short %} are in {% data variables.release-phases.public_preview %} and subject to change.
* Several {% data variables.copilot.copilot_code-review-tools_short %} are in {% data variables.release-phases.public_preview %} and subject to change.
* The [AUTOTITLE](/free-pro-team@latest/site-policy/github-terms/github-pre-release-license-terms) apply to your use of this product.
1 change: 1 addition & 0 deletions data/reusables/gated-features/copilot-sdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% data variables.copilot.copilot_sdk %} is available with all {% data variables.product.prodname_copilot_short %} plans.
5 changes: 5 additions & 0 deletions data/tables/copilot/model-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
excels_at: Complex code generation, debugging, and research workflows
further_reading: '[Gemini 3 Pro model card](https://storage.googleapis.com/deepmind-media/Model-Cards/Gemini-3-Pro-Model-Card.pdf)'

- name: Gemini 3.1 Pro
task_area: Deep reasoning and debugging
excels_at: Effective and efficient edit-then-test loops with high tool precision
further_reading: 'not applicable'

# xAI
- name: Grok Code Fast 1
task_area: General-purpose coding and writing
Expand Down
4 changes: 4 additions & 0 deletions data/tables/copilot/model-multipliers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
multiplier_paid: 1
multiplier_free: Not applicable

- name: Gemini 3.1 Pro
multiplier_paid: 1
multiplier_free: Not applicable

- name: GPT-4.1
multiplier_paid: 0
multiplier_free: 1
Expand Down
7 changes: 7 additions & 0 deletions data/tables/copilot/model-release-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@
ask_mode: true
edit_mode: true

- name: 'Gemini 3.1 Pro'
provider: 'Google'
release_status: 'Public preview'
agent_mode: true
ask_mode: true
edit_mode: true

# xAI models
- name: 'Grok Code Fast 1'
provider: 'xAI'
Expand Down
8 changes: 8 additions & 0 deletions data/tables/copilot/model-supported-clients.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@
xcode: true
jetbrains: true

- name: Gemini 3.1 Pro
dotcom: true
vscode: true
vs: true
eclipse: false
xcode: false
jetbrains: false

- name: GPT-4.1
dotcom: true
vscode: true
Expand Down
7 changes: 7 additions & 0 deletions data/tables/copilot/model-supported-plans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@
business: true
enterprise: true

- name: Gemini 3.1 Pro
free: false
pro: true
pro_plus: true
business: true
enterprise: true

- name: GPT-4.1
free: true
pro: true
Expand Down
9 changes: 7 additions & 2 deletions data/variables/copilot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ chat_completions_api: 'https://api.githubcopilot.com/chat/completions'
copilot_code-review: 'GitHub Copilot code review'
copilot_code-review_short: 'Copilot code review'
copilot_code-review-tools-preview_cap: 'New tools (public preview) in GitHub Copilot code review'
copilot_code-review-tools_short: 'new tools in Copilot code review'
copilot_code-review-tools_cap_short: 'New tools in Copilot code review'
copilot_code-review-tools_short: 'tools in Copilot code review'
copilot_code-review-tools_cap_short: 'Tools in Copilot code review'

## Copilot coding agent (previously Padawan) -> {% data variables.copilot.copilot_coding_agent %}
copilot_coding_agent: 'Copilot coding agent'
Expand Down Expand Up @@ -82,6 +82,10 @@ copilot_custom_agent_caps_short: 'Custom agent'
custom_agents_short: 'custom agents'
custom_agents_caps_short: 'Custom agents'

## Copilot SDK
copilot_sdk: 'GitHub Copilot SDK'
copilot_sdk_short: 'Copilot SDK'

## Copilot subagents
subagent_short: 'subagent'
subagent_caps_short: 'Subagent'
Expand Down Expand Up @@ -155,6 +159,7 @@ copilot_gemini_flash: 'Gemini 2.0 Flash'
copilot_gemini_3_flash: 'Gemini 3 Flash'
copilot_gemini_25_pro: 'Gemini 2.5 Pro'
copilot_gemini_3_pro: 'Gemini 3 Pro'
copilot_gemini_31_pro: 'Gemini 3.1 Pro'
# OpenAI GPT series:
copilot_gpt_4o: 'GPT-4o'
copilot_gpt_41: 'GPT-4.1'
Expand Down
Loading