Skip to content

Agent Host: Support expiring GitHub tokens with the Copilot SDK #335182

Closed as duplicate

Description

@TylerLeonhardt

Problem

Agent Host currently supplies a static GitHub token when creating Copilot SDK sessions. Some GitHub tokens have a known finite lifetime, and the Copilot SDK supports a gitHubTokenProvider callback for refreshing those credentials.

Without carrying token lifetime to Agent Host and selecting the provider callback, a long-running Copilot session can continue using an expired token or surface an interactive authentication prompt instead of requesting a fresh credential.

Desired behavior

  • Carry optional OAuth-style expiresIn through Agent Host authentication and reconnect/replay.
  • Deduct elapsed time when credentials are replayed and do not replay expired credentials.
  • Use a static gitHubToken when expiry is unknown.
  • Use gitHubTokenProvider when expiry is known, never both options at once.
  • Coalesce concurrent SDK refresh callbacks and map refresh requests to the existing Agent Host authentication-required flow.
  • Bound refresh waits so the SDK cannot wait indefinitely when no client supplies a replacement.
  • Restart the Copilot client when switching between static and provider-backed credential modes.

Implementation

Implemented by #334418, with unit coverage for credential selection, refresh coalescing, timeout behavior, replay, and mode transitions. The refresh path was also validated end to end with a real Microsoft-brokered GitHub token renewal.

Activity

  1. added this to the 1.138.0 milestone on Sep 9, 2026
  2. added
    feature-request
    authentication-github
    copilot-cli-agent
    agent-host
    on Sep 9, 2026
  3. added
    unreleased
    insiders-released
    verification-needed
    and removed
    unreleased
    on Sep 9, 2026
  4. added
    *duplicate
    and removed
    verification-needed
    on Oct 1, 2026
  5. removed this from the 1.141.0 milestone on Oct 1, 2026
  6. removed
    insiders-released
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicateagent-hostauthentication-githubcopilot-cli-agentfeature-request

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions