Repository navigation
fix(mcp): follow nextCursor in prompts/list, resources/list and resources/templates/list - #859
Open
yudongyouqing wants to merge 1 commit into
Open
yudongyouqing wants to merge 1 commit into
yudongyouqing wants to merge 1 commit into
Conversation
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.
Summary
raven/mcp/paging.pywalks a paginated list verb page by page withparams=PaginatedRequestParams(cursor=...), stopping on an absent or a repeated cursor (the rule fix(mcp): page through tools/list nextCursor #825 introduced fortools/list). The public surface is one typed walker per verb (walk_tools / walk_resources / walk_resource_templates / walk_prompts), so the items a caller loops over carry their real SDK type rather than the Any a session yields at these call sites; the page shape stays behind one private engine.resources/listandresources/templates/listinraven/mcp/resources.py, andprompts/listinraven/mcp/prompts.py. Each site keeps its existing_with_timeoutaround the whole walk, so a server that never stops paging fails visibly instead of stalling the turn.tools/listloop from fix(mcp): page through tools/list nextCursor #825 inraven/mcp/client.pycollapses onto the same helper, so all four verbs share one implementation.paramsargument the walker always passes.Type
Verification
uv run pytest tests/test_mcp_resources.py tests/test_mcp_prompts.py tests/test_mcp_client.py tests/test_mcp_manager.py-> 88 passed, including four new tests (multi-page resources, multi-page templates, repeated cursor, multi-page prompts)raven/changes and running them -> 4 failed; restoring the fix -> passruff check+ruff format --checkon the touched files;ty checkat the pre-change baseline (18 platform-only diagnostics on Windows, no new);lint-imports-> 10 contracts kept, 0 brokenRisk
Related Issues
Fixes #855