fix(feishu): paginate drive list/info to resolve files beyond first page#94030
Closed
xzh-icenter wants to merge 2 commits into
Closed
fix(feishu): paginate drive list/info to resolve files beyond first page#94030xzh-icenter wants to merge 2 commits into
xzh-icenter wants to merge 2 commits into
Conversation
- listFolder now accepts page_size and page_token params and returns has_more - getFileInfo now paginates through all pages when searching for a file by token - Added page_size and page_token to list action schema - Added folder_token to info action schema for scoped search - Added regression tests for pagination behavior Fixes openclaw#93928
Contributor
Author
|
Superseded by a clean rebased PR. |
This was referenced Jun 19, 2026
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
feishu_driveaction: inforeturnsFile not foundfor files past page 1, andaction: listcannot retrieve pages beyond the first — both ignore thehas_more/next_page_tokencursor the Lark API returns.listFolder()now acceptspage_sizeandpage_tokenparams and returnshas_morein the responsegetFileInfo()now paginates through all pages when searching for a file by token, instead of only checking the first pagelistaction schema now acceptspage_sizeandpage_tokenfor cursor-based paginationinfoaction schema now acceptsfolder_tokento narrow the search scopelist_comments,list_comment_replies) was already correct and untouched. No new dependencies added.infofinds files on any page.listcan be called withpage_tokento fetch subsequent pages.drive.tschanges tolistFolderandgetFileInfofunctions, anddrive-schema.tsschema additions.Linked context
Closes #93928
Was this requested by a maintainer?
Root Cause
getFileInfo()did a singledrive.file.listcall and only searched the first page results.listFolder()did not passpage_tokento the Lark SDK and the schema exposed no cursor field.listorinfoactions. The siblinglist_commentsandlist_comment_repliespaths already paginated correctly (seedrive.ts:486-487,519-520), making this the lone un-paginated lister in the plugin.Real behavior proof
feishu_driveinfomust find a file that lives past the firstdrive.file.listpage instead of falsely reportingFile not found.listmust support cursor-based pagination.fix/93928-drive-pagination-v2, realregisterFeishuDriveToolsruntime with Lark SDKdrive.file.listmocked.drive.file.listresponse shape mocked rather than a live multi-page folder.Tests and validation
Which commands did you run?
node scripts/run-vitest.mjs test/vitest/vitest.extension-feishu.config.ts -- extensions/feishu/src/drive.test.tsWhat regression coverage was added or updated?
paginates list action returning requested page— verifiespage_tokenis passed to SDK andhas_more/next_page_tokenare returnedpaginates getFileInfo through multiple pages to find file— verifies 3-page pagination to find a file on page 3throws File not found after exhausting all pages— verifies error after single-page search with no matchWhat failed before this fix, if known?
infoaction threwFile not found: <token>for any file past page 1listaction returned only page 1 with no way to fetch subsequent pages