Repository navigation
fix(mcp): port upstream auth status scoping to configured server URL (anomalyco/opencode#33924) - #1612
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
fix(mcp): port upstream auth status scoping to configured server URL (anomalyco/opencode#33924)#1612devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
25 of 71 tasks
This branch has not been deployed
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.
Issue for this PR
Closes #1572
Type of change
What does this PR do?
MCP.getAuthStatuslooked up stored OAuth tokens by server name only (auth.get(mcpName)). If a remote MCP server'surlchanged, or a legacy entry had no URL, credentials issued for a different server were reported asauthenticated. The status UI then shows the server as signed in while the real connection fails, and the user is never prompted to re-authenticate.Ported from upstream anomalyco/opencode#33924: read the server config and look the tokens up with
auth.getForUrl(mcpName, config.url), the same lookup the connect path already uses. Non-remote or unconfigured servers reportnot_authenticated. Wrapped inaltimate_changemarkers taggedupstream_fix:.How did you verify your code works?
New test in
test/mcp/oauth-auto-connect.test.tscovers legacy (URL-less) tokens, tokens for an old URL, tokens for the current URL, expired tokens and an unconfigured server. It fails onmainand passes on this branch.bun typecheckandbun run script/upstream/analyze.ts --markers --base origin/main --strictare clean.Cost side effects
None. One extra in-memory config lookup per status call.
Screenshots / recordings
N/A, no UI change.
Checklist
Written by Devin
Summary by cubic
Fixes MCP auth status so it only reports credentials stored for the configured server URL, ported from upstream anomalyco/opencode#33924.
Previously
getAuthStatuslooked up OAuth tokens by server name only, so credentials issued for a different URL were reported asauthenticatedafter a server URL change. The status now reads the server config and usesauth.getForUrl, the same lookup the connect path already uses. Unconfigured or non-remote servers reportnot_authenticatedinstead.Written for commit e089ed1. Summary will update on new commits.