feat(copilot): reauthenticate expired sessions in chat - #103
Merged
Merged
Conversation
Surface terminal Copilot authorization failures directly above the composer and reuse the device-code flow so users can reconnect without visiting Settings. Keep automatic renewal first, and offer reauthentication only for expired refresh credentials, revoked grants, or exhausted 401 recovery. Handle OAuth errors returned with HTTP 400, preserve drafts while signing in, and avoid prompting for outages, rate limits, policy denials, or locked keychains. Add backend, store, and real-browser coverage, and bump to 0.0.98. Co-authored-by: Roxy <299891354+roxy-commits@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Automatic Copilot token renewal now handles routine expiry, but GitHub can still revoke authorization or let the refresh credential expire. When that happens, sending users to Settings adds unnecessary friction.
What Changed
User Experience
The inline panel says that GitHub Copilot auth can be unreliable and provides Refresh GitHub Copilot login. After starting the flow, the user gets the device code plus Authenticate on GitHub, without leaving chat for Settings.
Verification
npm run build: passed, including node and web typechecksnpm run smoke:app: 731 checks passed, including expanded Copilot auth coveragenpm run smoke:canvas: 141 real-browser checks passed, including keyboard activation, code copying, GitHub launch, retry, narrow layout, reconnect confirmation, and draft preservationnpm run smoke:shared: 1094 checks passednpm run smoke:store: passednpm run smoke:i18n: 18 checks passednpm run i18n: all 656-key catalogs in syncgit diff --check: passedOne initial canvas run hit an existing flaky scrollbar-drag assertion before reaching the Copilot tests. The immediate rerun passed all 141 checks, including the new reconnect flow.