Repository navigation
fix(oauth): preserve account identity when pausing Anthropic credentials #6378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
53a0c80
fix(oauth): keep expired CLI slots out of pause fallback
luvs01 9053788
ci: retrigger (flaky multi-file batch wedge in test 2/4)
devin-ai-integration[bot] b9a92c3
Merge dev and bind Claude credential adoption to stored continuity
luvs01 ba908c9
Verify explicit legacy account selection without relaxing pause fallback
luvs01 d42848f
test(claude): give native-oauth fixtures credential provenance
devin-ai-integration[bot] c89dc21
Merge current dev before incorporating OAuth fixture provenance corre…
luvs01 a95c4dd
Merge OAuth fixture provenance correction with verified legacy accoun…
luvs01 59c788a
Merge current upstream dev before submitting focused change 692
luvs01 2bb62e5
test(oauth): declare provenance for pause API fixtures
luvs01 2192075
docs(ko): explain Anthropic no-fallback recovery
luvs01 3db2ab4
fix(oauth): restore stored-credential legacy pause fallback
luvs01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /** Refresh early enough to avoid dispatching a bearer that expires in flight. */ | ||
| export const REFRESH_SKEW_MS = 60_000; |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
The continuity gate rejects a legitimate Claude Code two-token rotation and leaves OpenCodex holding a consumed refresh token.
hasClaudeCredentialContinuityreturnsfalseonly when bothaccessandrefreshdiffer from the stored values. A normal Claude Code refresh produces exactly that state: Claude Code sends the stored refresh token, and Anthropic returns a new access token and a new refresh token. Thelocal-clirow then fails atsrc/oauth/index.tsLine 872.refreshAnthropicAccountWithLockcontinues todef.refresh(stored.refresh, …)with a refresh token that is already consumed.There are two possible outcomes:
invalid_grant, and the account is markedneedsReauth.The maintainer review on head
2bb62e5reports this regression, and the author agrees. The new test attests/oauth/local-token-detect.test.tsLine 145-150 expects this rejection, so the suite does not catch the regression.A fix needs an identity contract that does not depend on token equality. Two options:
local-clirows when the disk credential comes from the same storage location that the row was imported from, as before this PR. Apply the continuity gate only when the row was promoted from a different account, which is the pause-fallback case.Until one of these exists, rejecting a two-token rotation trades one account-confusion risk for a guaranteed refresh failure on the default Claude Code import path.
🤖 Prompt for AI Agents