Repository navigation
fix(auth): let concurrent agent processes refresh one MCP credential - #359
Merged
Merged
Conversation
Codex processes share one stored Fanout login. When two refreshed at once, the second presented the token the first had just rotated, and reuse detection revoked the whole family, signing every process out (35 rejected refreshes on production within minutes). A refresh token rotated within the last minute is now admitted for the same client and resource while its family is still live, and that sibling receives its own pair in the family. Its rotation time is not moved, so the window cannot extend. Later reuse, or reuse against a revoked family, still revokes the family. Access tokens now last an hour instead of 15 minutes. Every request checks them against the database, so revocation remains immediate, and refreshes, and the chance of such races, fall fourfold. Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
A clock stepped back after a rotation made the elapsed time negative, which counted as inside the grace window and could stretch it to the size of the step. A future-dated rotation is now reuse. Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
… grace window A token rotated just before expiry and replayed just after qualified as a sibling, then failed the expiry check without revoking its family. Only an unexpired rotated token can be a sibling. Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
vishr
force-pushed
the
fix/oauth-refresh-grace
branch
from
October 19, 2026 19:39
f7430ae to
44f9ddf
Compare
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.
Codex processes share one stored Fanout login. When two refresh at once, the second presents the refresh token the first just rotated. Reuse detection then revoked the whole family and signed every process out: production logged 35 rejected
/oauth/tokenrequests within minutes on 2026-10-19.The owner approved this trade-off:
docs/authentication.mdupdated.Tests:
Verification:
just checkpasses.https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ