Skip to content

fix(feishu): paginate drive file list and info actions#94026

Closed
bladin wants to merge 1 commit into
openclaw:mainfrom
bladin:fix/93928-feishu-drive-pagination
Closed

fix(feishu): paginate drive file list and info actions#94026
bladin wants to merge 1 commit into
openclaw:mainfrom
bladin:fix/93928-feishu-drive-pagination

Conversation

@bladin

@bladin bladin commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What changed

Feishu drive list and info actions now support pagination:

  1. listFolder accepts page_size and page_token parameters, passes them to client.drive.file.list, and returns has_more alongside next_page_token so callers can page through the entire folder.
  2. getFileInfo follows has_more/next_page_token pagination loops instead of searching only the first page and throwing File not found for files that live beyond page 1.
  3. drive-schema.ts adds page_size and page_token to the list action schema (matching the wiki schema pattern), so the LLM can request subsequent pages.
  4. Tests add 5 new regression tests covering: list with pagination fields, list with page_size/page_token passthrough, info follows pagination to page 2, info throws when absent across all pages, info finds file on first page without pagination.

Why

Issue #93928 reports that feishu_drive info falsely returns File not found for files past the first API page, and list cannot retrieve any page after the first. Both surfaces ignore the has_more/next_page_token cursor the Lark API returns. This is the direct sibling of the wiki pagination fix (#37626), which paginated wiki.spaceNode.list/wiki.space.list but did not touch drive. The comment paths in the same plugin already paginate correctly (list_comments, list_comment_replies expose page_size + page_token).

Real behavior proof

Before fix

getFileInfo queried only page 1 (one list call) and threw "File not found: target";
list was never asked for page 2 despite has_more: true.

After fix

Test Files  1 passed (1)
Tests       20 passed (20)

- getFileInfo drains has_more/next_page_token to page 2 (two list calls), finds and returns the file
- listFolder accepts and passes page_size/page_token, returns has_more
- Existing 15 drive.test.ts tests stay green; 5 new pagination tests added

Evidence type: Terminal output (vitest run)

Setup: OpenClaw checkout at commit 87bdaef, Node.js v22.22.0, Linux x64

Fixes #93928

Drive file list/info actions ignored has_more/next_page_token cursors
from the Lark drive.file.list API, causing false File not found errors
for any file beyond the first page and making pages 2+ unreachable.

- listFolder now accepts pageSize/pageToken and returns has_more
- getFileInfo now drains has_more/next_page_token pages until found
- drive-schema.ts adds page_size/page_token to list action
- 5 new test cases covering pagination scenarios

Fixes openclaw#93928
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feishu drive info falsely reports File not found for files past page 1 (list pagination already fixed in #101572)

1 participant