Repository navigation
fix(core): align ChatGPT token sharing with updated partner guide - #52162
Merged
Merged
Conversation
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.
Two fixes from the updated token-sharing guidance.
Error codes
The guide renamed the token-sharing error codes (dropped the
v2_prefix) and added twochatpass_v2_*codes. Our retry list and error messages still used the old names, and since matching is by substring, the new codes never matched — e.g.subscription_sharing_user_not_eligiblewas being retried and shown with the raw message.nonRetryableSharingCodesandtokenSharingMessageschatpass_v2_scope_not_authorizedandchatpass_v2_invalid_authorization_context(non-retryable, with a message)subscription_sharing_v2_client_not_enabled, which the guide no longer listsClient ID on reauthorization
The callback used
result.clientID ?? savedID, so a reauthorization callback with a different client ID would silently switch the connection to another registration. The guide says to reject that. The saved client ID now wins, and a mismatch fails the attempt without saving a credential. New registrations still use the callback's client ID.Tests
provider-chatgpt.test.tsandsession-error.test.tsclient_idfails and creates no credential