Skip to content

[Task] Add automatic GitHub App token refresh to the Copilot SDK #2540

Description

@gfarb

Outcome

Long-running SDK sessions can refresh GitHub App credentials without restarting the session or forcing repeated OAuth flows.

Scope

  • Add a supported credential-provider mechanism for lazy or proactive refresh
  • Support S2S installation token re-minting before or after the one-hour expiry
  • Support U2S refresh tokens and discoverable token lifetime policies
  • Retry safely when a token expires during a turn
  • Replace reliance on the experimental session.auth.setCredentials workaround
  • Preserve existing static token behavior

Acceptance criteria

  • A session running longer than one S2S token lifetime continues without manual token injection
  • A request encountering token expiry can obtain a fresh credential and retry without duplicating unsafe work
  • U2S refresh does not force a new interactive OAuth flow on normal expiry
  • Refresh failures surface clearly and never silently fall back to another identity
  • Node, Go, .NET, and Java SDK behavior is consistent or explicitly staged
  • Public SDK documentation includes secure private-key and refresh guidance

Dependencies

Coordinate runtime credential update behavior with the bundled CLI. The basic gitHubToken acceptance fix remains tracked in github/copilot#30423.

References

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions