You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agent Host: Support expiring GitHub tokens with the Copilot SDK #335182
*duplicateIssue identified as a duplicate of another issue(s)agent-hostIssues for the agent-host implementation (not the protocol)authentication-githubIssues with the GitHub Authentication extensioncopilot-cli-agentBackground Agent related features/bugsfeature-requestRequest for new features or functionality
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.
*duplicateIssue identified as a duplicate of another issue(s)agent-hostIssues for the agent-host implementation (not the protocol)authentication-githubIssues with the GitHub Authentication extensioncopilot-cli-agentBackground Agent related features/bugsfeature-requestRequest for new features or functionality
Activity