Repository navigation
fix(mcp): preserve refresh credentials when callback URL changes - #1
Merged
neubig merged 2 commits intoNov 15, 2026
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Keep the installed client available for refresh. Reuse FastMCP stale-client retry only when a new authorization flow needs another redirect URI. Co-authored-by: openhands <openhands@all-hands.dev>
1 of 5 tasks
neubig
merged commit Nov 15, 2026
0394521
into
2Zest:codex/mcp-oauth-public-callback
2 checks passed
Author
|
The failing-test commit This comment was created by an AI agent (OpenHands) on behalf of Graham Neubig. |
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
Follow-up to OpenHands#6221. Changing the public callback URL must not require consent again while the installed client's refresh token is still usable.
Summary
ff76595b7f6528e202bb7cb8d05c9732fe1daacd: failing regression test, pushed before the fix.039452194: defer the redirect-registration check until fresh authorization; use FastMCP's existing one-time stale-client retry.The test uses a real FastMCP OAuth provider and the agent-server start/status APIs. Only the saved expiry is advanced; tokens and registration come from a complete authorization-code exchange. It verifies tool discovery, retained client identity, new expiry, no extra registration, and provider-side refresh-token rotation.
How to Test
uv run pytest tests/agent_server/test_mcp_oauth_redirect.py -qBefore fix: new regression fails at
assert "authorization_url" not in started(reproduced twice). Baseline: 17 passed. After fix: all 18 redirect tests pass, including re-registration when fresh authorization is necessary. Wider related suite is running.Ruff, pycodestyle, import guards and
pyright --project pyproject.tomlpass for both changed files. The default local pyright hook finds an unrelated/tmp/pyrightconfig.json; its project-explicit equivalent passes. Tests use existing compatible dependencies, not a new environment sync; upstream CI remains necessary for the locked full environment.Scope
Base is the branch of upstream PR OpenHands#6221, not main. Merge this follow-up into that branch before merging the upstream SDK PR. Canvas PR OpenHands/OpenHands#19744 needs no code change for this regression. No release versions, settings, or API contracts change here.
This PR was created by an AI agent (OpenHands) on behalf of Graham Neubig.