Skip to content

Generating a Copilot commit message prompts for MCP OAuth keychain access #23196

Open

Description

@samqbush

The problem

When I generate a commit message with Copilot in GitHub Desktop, macOS displays a keychain prompt:

copilot-runtime wants to use your confidential information stored in “copilot-mcp-oauth” in your keychain.

The dialog asks for the “login” keychain password and offers Always Allow, Deny, and Allow. I don't expect generating a commit message to need access to OAuth credentials for MCP servers configured outside Desktop, and the prompt does not explain why they are needed.

Release version

3.6.11

Operating system

macOS 27.2.1 (Apple silicon)

Steps to reproduce the behavior

  1. Have Copilot CLI configured with MCP servers that use OAuth, with an existing copilot-mcp-oauth keychain item.
  2. Open a repository with changes in GitHub Desktop.
  3. Use Copilot to generate commit details.
  4. Observe the keychain access prompt for copilot-runtime and copilot-mcp-oauth.

Log files

Not provided.

Screenshots

Not provided because the screenshot contains personal file names. The prompt text is quoted above.

Additional context

The installed app contains a GitHub-signed copilot-runtime. The prompt appears to be related to Desktop's runtime discovering the existing Copilot CLI MCP configuration, but I haven't verified the precise initialization path or whether granting access is necessary for commit message generation.

Ideally, commit message generation would not load unrelated MCP credentials; alternatively, Desktop could explain why access is necessary. Could Desktop isolate its Copilot configuration or avoid initializing MCP servers for this feature?

Activity

  1. added
    bug
    priority-3
    on Nov 17, 2026
  2. desktop-triage commented on Nov 17, 2026

    @desktop-triage

    Triage summary: This is a reproducible bug with clear steps, version, and OS — requesting bug (confidence: HIGH). I'm requesting priority-3 (confidence: MEDIUM) since it affects a narrow set of users who have Copilot CLI MCP servers with OAuth-backed keychain items configured, and a workaround (deny the prompt) likely exists, though the keychain-access nature of the prompt is a privacy-sensitive detail worth engineering attention. No duplicate issues were found in desktop/desktop.

    Initial hypothesis: CopilotStore.generateCommitMessage creates its Copilot runtime client via this.createClient(account, repositoryPath, credentials) with no env override (

    try {
    client = await awaitCancellableCopilotOperation(
    () => this.createClient(account, repositoryPath, credentials),
    {
    signal,
    cancellationError: () => new CommitMessageGenerationCancelledError(),
    disposeLateValue: lateClient => this.stopClient(lateClient),
    }
    )
    ), whereas assisted-commit planning explicitly scopes the spawned runtime's environment to an allowlist via getAssistedCommitClientEnvironment() before calling the same createClient (
    /** Reuse current session-bound authentication with the planner's isolated runtime policy. */
    protected async createAssistedCommitClient(
    account: Account,
    repositoryPath: string
    ): Promise<ICopilotPlanningClient> {
    const client = await this.createClient(
    account,
    repositoryPath,
    this.createCredentialContext(account),
    {
    logLevel: 'none',
    env: getAssistedCommitClientEnvironment(),
    }
    )
    return getCopilotPlanningClient(client, config =>
    this.createSession(client, config)
    )
    }
    , allowlist defined at
    export function getAssistedCommitClientEnvironment(
    environment: NodeJS.ProcessEnv = process.env
    ): Record<string, string | undefined> {
    return Object.fromEntries(
    [
    'HOME',
    'USERPROFILE',
    'HOMEDRIVE',
    'HOMEPATH',
    'COPILOT_HOME',
    'XDG_CONFIG_HOME',
    'PATH',
    'TMPDIR',
    'TEMP',
    'TMP',
    'NODE_EXTRA_CA_CERTS',
    'SSL_CERT_FILE',
    'SSL_CERT_DIR',
    ].map(key => [key, environment[key]])
    )
    }
    ). Inside createClient itself (
    private async createClient(
    account: Account,
    repositoryPath?: string,
    credentials: ICopilotCredentialContext = this.createCredentialContext(
    account
    ),
    options: Pick<CopilotClientOptions, 'logLevel' | 'env'> = {}
    ): Promise<CopilotClient> {
    const runtimePath = getCopilotRuntimePath(join(__dirname, 'copilot'))
    if (!(await pathExists(runtimePath))) {
    throw new Error(
    'Cannot create Copilot client: Runtime entry point not found'
    )
    }
    const { accessToken } = await credentials.getToken()
    if (!accessToken) {
    throw new Error('Cannot create Copilot client: Account has no token')
    }
    const client = new CopilotClient({
    connection: RuntimeConnection.forStdio({
    path: runtimePath,
    }),
    env: {
    ...options.env,
    GH_HOST: getCopilotGHHost(account),
    GITHUB_COPILOT_INTEGRATION_ID: `copilot-desktop${
    __DEV__ ? '-dev' : ''
    }`,
    },
    workingDirectory: repositoryPath,
    logLevel: options.logLevel,
    sessionFs: getCopilotInMemorySessionFsConfig(
    repositoryPath,
    __WIN32__ ? 'windows' : 'posix'
    ),
    gitHubToken: accessToken,
    })
    if (credentials.tokenProvider !== undefined) {
    this.clientTokenProviders.set(client, credentials.tokenProvider)
    }
    return client
    }
    ), the spawned copilot-runtime process only receives extra GH_HOST/GITHUB_COPILOT_INTEGRATION_ID vars layered on top of whatever options.env is passed — for commit-message generation that's undefined, so the runtime process inherits the full host environment (e.g. HOME/XDG_CONFIG_HOME), letting it discover the user's real Copilot CLI config, including any MCP servers with OAuth secrets in copilot-mcp-oauth, before session-level flags like enableConfigDiscovery: false (set in createSession,
    /** Preserve custom instructions without discovering hooks, config, or skills. */
    private createSession(client: CopilotClient, config: SessionConfig) {
    const provider = config.provider
    // The runtime reserves 'auto' for Copilot routing. Use a session alias
    // for custom providers where, for whatever reason, the model is named 'auto',
    // while keeping the provider's actual model name on the wire.
    const isProviderAuto = provider !== undefined && config.model === 'auto'
    return client.createSession({
    ...config,
    enableFileHooks: false,
    enableConfigDiscovery: false,
    enableSkills: false,
    model: isProviderAuto ? 'byok-auto' : config.model,
    provider: isProviderAuto
    ? {
    ...provider,
    wireModel: provider.wireModel ?? config.model,
    }
    : provider,
    gitHubTokenProvider:
    provider === undefined
    ? this.clientTokenProviders.get(client)
    : undefined,
    })
    }
    ) can take effect. This would explain why the keychain prompt surfaces for a Desktop feature that shouldn't need external MCP credentials, and suggests commit message generation may need the same environment-scoping treatment already used for assisted-commit planning. This has not been confirmed against the actual copilot-runtime/copilot-sdk startup behavior (not in this repo), so it remains a hypothesis pending reproduction.

    Generated by Issue Triage (skills-driven) for #23196 · auto · 86.3 AIC · ⊞ 4.7K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions