fix(feishu): add pagination support for drive list and info#94000
fix(feishu): add pagination support for drive list and info#94000ajwan8998 wants to merge 17 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 5:53 AM ET / 09:53 UTC. Summary PR surface: Source +69, Tests +213, Docs +14. Total +296 across 4 files. Reproducibility: yes. source-reproducible: current main exposes no list cursor input, listFolder calls drive.file.list once, and getFileInfo searches one response before File not found. I did not run a live Feishu tenant reproduction. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land a Feishu-plugin-local cursor pagination fix after live Feishu proof or maintainer override, a cursor-safe fetch-all decision, passing lint, and skill docs that match the new scoped info behavior. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main exposes no list cursor input, listFolder calls drive.file.list once, and getFileInfo searches one response before File not found. I did not run a live Feishu tenant reproduction. Is this the best way to solve the issue? No. Cursor pagination and paginated info lookup are the right plugin-local repair, but the current PR still needs a cursorless fetch-all guard or product acceptance, lint repair, docs alignment, and live proof or override. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 738b2be4b49b. Label changesLabel justifications:
Evidence reviewedPR surface: Source +69, Tests +213, Docs +14. Total +296 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
drive list and drive info only checked the first page of results (default page size 10). When a folder contained more files than one page, list would silently return incomplete results and info would throw 'File not found' for files on subsequent pages. Fix: - listFolder: add pagination loop with has_more/next_page_token - getFileInfo: search across all pages using pagination - drive-schema: add page_size, page_token, all parameters to list action Closes: openclaw#93928 Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
…60617t082059-002-20260617a (1)
|
Clownfish 🐠 reef update Thanks for the contribution here. Clownfish nudged this branch back into the current, so the original PR can stay the review lane. Source PR: #94000 fish notes: model gpt-5.5, reasoning medium; reviewed against 6600c86. |
dadddf3 to
6600c86
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
Add MAX_LIST_PAGES cap (100) to the all-pages pagination loop so a repeated or missing next_page_token from the Feishu API does not cause unbounded requests.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
4 similar comments
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
Guard against API returning repeated cursors: track seen page tokens and break on duplicates. Prevents duplicate file entries and wasteful repeated requests even before MAX_LIST_PAGES is reached. Closes: openclaw#93928
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
The manual Closing this broader candidate rather than landing its automatic Thank you @ajwan8998 for the implementation and regression investigation. |
What Problem This Solves
Feishu drive
listandinfoactions do not handle pagination. When a folder has more files than the default API page size (10),listreturns only the first page.infosearches only the first page and falsely reportsFile not foundfor any file beyond page 1.Root cause:
listFolderandgetFileInfocallclient.drive.file.list()once without readinghas_moreornext_page_token. The Lark API supports cursor-based pagination but the tool ignores both cursor fields.Changes
extensions/feishu/src/drive-schema.ts: addpage_size,page_token,alltolistactionextensions/feishu/src/drive.ts:listFolder: pagination loop withMAX_LIST_PAGES = 100, cursor dedup viaseenTokensgetFileInfo: iterate all pages beforeFile not found, cursor dedupextensions/feishu/src/drive.test.ts: pagination testsReal behavior proof
npx tsx -ewithFeishuDriveSchemaimported via TypeBox. Pagination logic replicated and verified withnode --input-type=module. OpenClaw 2026.6.10, Node v24.Tests:
node scripts/run-vitest.mjs extensions/feishu/src/drive.test.ts --run→ 19 passed (19).Evidence
What was not tested: End-to-end with a real Feishu tenant (requires credentials). Pagination loop verified through unit tests (19 passed) and isolated logic proof.