Repository navigation
fix(mcp): ChatGPT links missing a tool's write scope are told to reconnect - #126
Merged
Merged
Conversation
…nnect Key the reconnect steps on the tool's first declared scope instead of on all its x-oauth-scopes, so a link holding accounts:read but not accounts:write gets the steps when the API refuses a profile or account write. A :write scope still counts as holding its :read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
Since Schedule-Posts-API #10188, a token with
accounts:readbut notaccounts:writegets a read-only 403 on account and profile writes. About 3,200 ChatGPT links are in that state.MissingScopeMiddlewareshowed the reconnect steps only when the token held none of the tool's x-oauth-scopes. The spec still listsaccounts:readon writes, so these links got a bare error with no way forward.What
MissingScopeMiddlewarenow shows the steps when the token lacks the tool's first declared scope (reaching[0]: the:writescope for a write, the:readscope for a read). A:writescope still counts as holding its:read, so the existing "a write scope reaches the read" case still gets the API's own error._log_group_refusalruns as before, andchallengednow follows the new decision._SCOPE_PURPOSEgets an entry foraccounts:write, so the steps name it in plain words.posts:read/accounts:readon writes, because it depends only on the first declared scope.Tests
posts:write accounts:readcallingprofiles_create_profilethat gets the read-only 403 now sees the reconnect steps namingaccounts:write.accounts:write, or an API key, still gets the API's own error.:readscope still shows the steps (existingtest_a_link_without_the_tools_scope_is_asked_to_relink).🤖 Generated with Claude Code