Repository navigation
share token refresh between mcp integrations in token-session - #78
Merged
Merged
Conversation
hkonsti
added this pull request to stack #88
October 13, 2026 21:06
hkonsti
force-pushed
the
hkonsti/google-1-token-session
branch
2 times, most recently
from
October 14, 2026 17:29
201de1b to
11516a1
Compare
…d call in the same request doesn't use a replaced refresh token
hkonsti
force-pushed
the
hkonsti/google-1-token-session
branch
from
October 15, 2026 00:12
11516a1 to
c4f09ca
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.
Moves the generic half of
mcp/mcp-session.ts(reading the encrypted credential, refreshing it as it runs out, one refresh at a time per connection, the compare-and-swap save and the one retry oncredentials_rejected) intoconnections/token-session.ts, which knows nothing of MCP: aTokenRefresher<C>gives it the provider's name, credential schema, expiry check and refresh.callMcpToolForis now a thin wrapper overcallWithToken, so the Google Workspace connector can reuse the same refresh logic. No behavior change; the existingmcp-sessiontests pass unchanged andtoken-session.test.tscovers the shared module. The in-flight refresh map now holds the new credential as stored, and each request sharing it decrypts it for itself, so the module-level map stays typed without a cast across providers.Stack: 1 of 3 for the Google Workspace connector; next: Google OAuth and the Drive files collection.
Open workspace in Conductor