Skip to content

fix(core): align ChatGPT token sharing with updated partner guide - #52162

Merged
rekram1-node merged 1 commit into
v2from
chatgpt-guide-fixes
Sep 29, 2026
Merged

rekram1-node merged 1 commit into
v2from
chatgpt-guide-fixes

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Two fixes from the updated token-sharing guidance.

Error codes
The guide renamed the token-sharing error codes (dropped the v2_ prefix) and added two chatpass_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_eligible was being retried and shown with the raw message.

  • Rename the codes in nonRetryableSharingCodes and tokenSharingMessages
  • Add chatpass_v2_scope_not_authorized and chatpass_v2_invalid_authorization_context (non-retryable, with a message)
  • Drop subscription_sharing_v2_client_not_enabled, which the guide no longer lists

Client 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

  • Updated code tables in provider-chatgpt.test.ts and session-error.test.ts
  • New test: a reauthorization callback with a different client_id fails and creates no credential

@rekram1-node
rekram1-node merged commit 0f83038 into v2 Sep 29, 2026
9 of 10 checks passed
@rekram1-node
rekram1-node deleted the chatgpt-guide-fixes branch September 29, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant