Skip to content

Latest commit

 

History

History
180 lines (138 loc) · 5.36 KB

client-info.md

File metadata and controls

180 lines (138 loc) · 5.36 KB

Client info

Client info attributes runtime telemetry to your application and integration. Valid application names and versions also set Editor-Version on CAPI requests, even with telemetry disabled. vscode-agent-host uses vscode/<version> for CAPI audiences. Integration fields identify an extension or plugin for telemetry; they do not replace Copilot-Integration-Id. Omit application identity to retain the runtime's default CAPI identity.

When to set client info

Set client info when your SDK application represents a distinct product, service, or integration whose runtime activity should be attributed consistently.

Leave client info unset for scripts, one-off tools, and jobs that do not represent a distinct application. The runtime then keeps its default attribution.

Client info has four optional string fields. Set the fields you know and omit the rest. The SDK includes client info in the server.connect handshake only when at least one field has a non-empty value.

Field Example Meaning
applicationName "vscode" Name of the application using the SDK
applicationVersion "1.124.2" Version of the application using the SDK
integrationName "copilot-chat" Name of the extension, plugin, or other application sub-part using the SDK
integrationVersion "0.54.0" Version of that extension, plugin, or application sub-part

For a standalone application without a distinct integration, set only the application fields. For example, a developer portal could set applicationName to "acme-developer-portal" and applicationVersion to "2.4.0", leaving both integration fields unset.

The SDK sends client info once when it establishes the connection. A successful host resume refreshes the session's CAPI editor identity, including when the runtime survives an application update. Extension attachments and clients without a valid application identity do not replace it. Sessions shared by hosts with different versions use the latest successfully resumed host's identity.

Configure client info

Pass client info when you create the client:

TypeScript
import { CopilotClient } from "@github/copilot-sdk";

const client = new CopilotClient({
  clientInfo: {
    applicationName: "vscode",
    applicationVersion: "1.124.2",
    integrationName: "copilot-chat",
    integrationVersion: "0.54.0",
  },
});

await client.start();
Python
from copilot import CopilotClient

client = CopilotClient(
    client_info={
        "application_name": "vscode",
        "application_version": "1.124.2",
        "integration_name": "copilot-chat",
        "integration_version": "0.54.0",
    },
)
await client.start()
Go
package main

import (
	"context"

	copilot "github.com/github/copilot-sdk/go"
)

func main() {}

func start(ctx context.Context) error {
client := copilot.NewClient(&copilot.ClientOptions{
    ClientInfo: &copilot.ClientInfo{
        ApplicationName:    "vscode",
        ApplicationVersion: "1.124.2",
        IntegrationName:    "copilot-chat",
        IntegrationVersion: "0.54.0",
    },
})
if err := client.Start(ctx); err != nil {
    return err
}
	return nil
}
client := copilot.NewClient(&copilot.ClientOptions{
    ClientInfo: &copilot.ClientInfo{
        ApplicationName:    "vscode",
        ApplicationVersion: "1.124.2",
        IntegrationName:    "copilot-chat",
        IntegrationVersion: "0.54.0",
    },
})
if err := client.Start(ctx); err != nil {
    return err
}
.NET
using GitHub.Copilot;

await using var client = new CopilotClient(new CopilotClientOptions
{
    ClientInfo = new CopilotClientInfo
    {
        ApplicationName = "vscode",
        ApplicationVersion = "1.124.2",
        IntegrationName = "copilot-chat",
        IntegrationVersion = "0.54.0",
    },
});

await client.StartAsync();
Java
var options = new CopilotClientOptions()
    .setClientInfo(new ClientInfo()
        .setApplicationName("vscode")
        .setApplicationVersion("1.124.2")
        .setIntegrationName("copilot-chat")
        .setIntegrationVersion("0.54.0"));

var client = new CopilotClient(options);
client.start().get();
Rust
use github_copilot_sdk::{Client, ClientInfo, ClientOptions};

let client = Client::start(
    ClientOptions::new().with_client_info(
        ClientInfo::new()
            .with_application_name("vscode")
            .with_application_version("1.124.2")
            .with_integration_name("copilot-chat")
            .with_integration_version("0.54.0"),
    ),
)
.await?;

Notes

  • Client info is advisory. The runtime can ignore values that do not match the expected format, such as an invalid version string.
  • Setting client info changes how the runtime attributes its telemetry. It does not change what the runtime records.
  • If every field is unset or empty, the SDK omits client info from the handshake and the runtime keeps its default attribution.