Skip to content

fix(feishu): support drive folder pagination#101567

Closed
steipete wants to merge 2 commits into
mainfrom
codex/fix-feishu-drive-pagination
Closed

fix(feishu): support drive folder pagination#101567
steipete wants to merge 2 commits into
mainfrom
codex/fix-feishu-drive-pagination

Conversation

@steipete

@steipete steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Feishu Drive folder listings return next_page_token, but the feishu_drive tool could not accept that cursor, leaving every page after the first unreachable.

This replaces #101249 because its contributor branch is 159 main commits and 903 files behind; the repo-native maintainer sync repeatedly timed out on the oversized rebase. The original contribution and author credit are preserved here.

Why This Change Was Made

  • Add bounded page_size and page_token inputs to the existing list action.
  • Normalize folder and cursor tokens and validate page_size at runtime, not only in the model schema.
  • Scope cursors to a concrete shared folder; Feishu bot credentials have no browsable root, so pagination is not forwarded for omitted, blank, or "0" folder tokens.
  • Document one-page continuation in the bundled Feishu Drive skill.

The change stays plugin-local and preserves the existing response shape. It does not broaden into automatic recursive pagination or the separate info lookup behavior tracked by #93928.

User Impact

Agents can retrieve subsequent pages of a shared Feishu Drive folder by passing the returned next_page_token as page_token with the same folder_token. Invalid page sizes now fail before an API request.

Evidence

  • Upstream @larksuiteoapi/node-sdk source confirms drive.file.list accepts folder_token, page_size, and page_token, and returns next_page_token / has_more.
  • Contributor gateway proof on fix(feishu): folder listings can continue after first page #101249 exercised /tools/invoke through the bundled tool and captured the expected SDK-boundary continuation request.
  • Sanitized AWS baseline: cbx_e1b51e13a04a, run run_ef117899bd4c; 16/16 Feishu Drive tests passed on the contributor head.
  • oxfmt on all touched code/skill files; git diff --check; skill YAML frontmatter parse.
  • Fresh GPT-5.5 autoreview of the complete replacement diff: clean, confidence 0.88.
  • Exact replacement-head sanitized AWS and hosted CI/Testbox evidence will be posted before merge.

Closes the list continuation portion of #93928. Supersedes #101249.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: S maintainer Maintainer-authored PR labels Jul 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46e3f4fd78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CHANGELOG.md Outdated

### Fixes

- **Feishu Drive folder pagination:** accept continuation tokens and bounded page sizes for shared-folder listings so agents can retrieve pages beyond the first without forwarding invalid root cursors. (#101249) Thanks @zhangguiping-xydt.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the manual changelog entry

For this normal Feishu fix, root AGENTS.md says CHANGELOG.md is release-only and should not be edited for normal PRs or direct fixes; release generation derives entries from merged PRs and direct commits. Keeping this manual Unreleased line can make generated release notes duplicate or drift from the canonical process, so move the release-note context to the PR/squash/direct commit metadata and drop this line.

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android gateway Gateway runtime size: M and removed size: S labels Jul 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 729ba20546

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


describe("TUI PTY real backends", () => {
afterEach(async () => {
describe.concurrent("TUI PTY real backends", () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the real PTY smoke suite serial

When the local PTY lane includes this file (OPENCLAW_TUI_PTY_INCLUDE_LOCAL=1), describe.concurrent makes every it/it.each in this real-backend suite run together even though test/vitest/vitest.tui-pty.config.ts sets maxWorkers: 1 and fileParallelism: false for the lane. These cases each spawn PTYs, local Gateways, and mock model servers with timing-sensitive waits, so running them all at once can starve the processes and make the smoke lane flaky or time out; keep this describe serial and use per-test cleanup.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 6:39 AM ET / 10:39 UTC.

Summary
The branch adds page_size and page_token to the Feishu Drive list action, forwards them to client.drive.file.list, updates the bundled drive skill, and adds focused regression tests.

PR surface: Source +40, Tests +192, Docs +15, Other +92. Total +339 across 10 files.

Reproducibility: yes. Current main returns next_page_token from listFolder, but the list schema and dispatcher cannot accept a continuation token, so the page-2 failure is source-reproducible without a live tenant.

Review metrics: 1 noteworthy metric.

  • Feishu Drive list inputs: 2 added. The PR expands the model-facing feishu_drive list contract with cursor and page-size inputs, which maintainers should notice before merge.

Stored data model
Persistent data-model change detected: persistent cache schema: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatLinkPreview.kt, serialized state: src/gateway/mcp-http.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: partial_overlap
Canonical: #93928
Summary: This PR is a maintainer replacement for the manual Feishu Drive list continuation fix, while the canonical issue still tracks the broader list and info pagination problem.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

Maintainer options:

  1. Decide the mitigation before merge
    Land this bounded Feishu list continuation fix after exact-head checks are acceptable, keep Feishu drive info falsely reports File not found for files past page 1 (list pagination already fixed in #101572) #93928 open for info pagination, and close the superseded source PR only after the replacement lands.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No repair job is needed; this is a protected maintainer-labeled replacement PR with no source-level findings, while CI and landing checks remain normal merge gates.

Security
Cleared: No concrete security or supply-chain concern was found; the merge-result diff stays within Feishu plugin schema/runtime, skill docs, and tests.

Review details

Best possible solution:

Land this bounded Feishu list continuation fix after exact-head checks are acceptable, keep #93928 open for info pagination, and close the superseded source PR only after the replacement lands.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main returns next_page_token from listFolder, but the list schema and dispatcher cannot accept a continuation token, so the page-2 failure is source-reproducible without a live tenant.

Is this the best way to solve the issue?

Yes for the narrow list claim. Forwarding optional cursor fields in the Feishu plugin matches the Lark SDK and sibling pagination patterns, while the separate info pagination bug remains tracked in #93928.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 942b44966107.

Label changes

Label changes:

  • add P2: This is a normal-priority Feishu plugin bugfix with limited blast radius to Drive folder listing.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The related contributor proof exercised /tools/invoke through the bundled Feishu Drive tool and captured the expected SDK-boundary continuation request; it is sufficient for this bounded list-path review, though not a live-tenant proof.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The related contributor proof exercised /tools/invoke through the bundled Feishu Drive tool and captured the expected SDK-boundary continuation request; it is sufficient for this bounded list-path review, though not a live-tenant proof.

Label justifications:

  • P2: This is a normal-priority Feishu plugin bugfix with limited blast radius to Drive folder listing.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The related contributor proof exercised /tools/invoke through the bundled Feishu Drive tool and captured the expected SDK-boundary continuation request; it is sufficient for this bounded list-path review, though not a live-tenant proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The related contributor proof exercised /tools/invoke through the bundled Feishu Drive tool and captured the expected SDK-boundary continuation request; it is sufficient for this bounded list-path review, though not a live-tenant proof.
Evidence reviewed

PR surface:

Source +40, Tests +192, Docs +15, Other +92. Total +339 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 3 45 5 +40
Tests 3 196 4 +192
Docs 2 18 3 +15
Config 0 0 0 0
Generated 0 0 0 0
Other 2 94 2 +92
Total 10 353 14 +339

What I checked:

  • Current main cannot accept list cursors: On current main, the list schema exposes only folder_token, so a returned next_page_token has no model-facing input path. (extensions/feishu/src/drive-schema.ts:23, 942b44966107)
  • Current main returns a cursor but dispatches no cursor: listFolder returns next_page_token, but the dispatcher calls it with only p.folder_token, leaving page 2 unreachable from the tool surface. (extensions/feishu/src/drive.ts:328, 942b44966107)
  • Merge-result surface is Feishu-only: The GitHub merge ref compared to current main changes only the Feishu Drive skill, schema, runtime, and tests; stale-base Android/Gateway/TUI/CHANGELOG diffs do not survive as PR-introduced merge-result changes. (b2b719c5d0c0)
  • PR forwards bounded list pagination: At PR head, listFolder trims the folder token, validates page_size, forwards page_token only with a concrete folder, and the dispatcher passes the new fields into that helper. (extensions/feishu/src/drive.ts:329, 729ba205469e)
  • PR updates the model-facing schema: The PR adds optional page_size and page_token to the list action schema with the same 1-200 bound enforced at runtime. (extensions/feishu/src/drive-schema.ts:29, 729ba205469e)
  • Upstream SDK supports these fields: The upstream Lark SDK generated source declares drive.file.list params page_size, page_token, and folder_token, and response fields next_page_token and has_more.

Likely related people:

  • doodlewind: GitHub commit metadata maps the community Feishu plugin introduction to this handle, and that commit added the Drive runtime, schema, and bundled Drive skill touched by this PR. (role: introduced Feishu drive surface; confidence: high; commits: 2267d58afcc7; files: extensions/feishu/src/drive.ts, extensions/feishu/src/drive-schema.ts, extensions/feishu/skills/feishu-drive/SKILL.md)
  • wittam-01: Path history shows this contributor added and hardened Feishu drive comment and reply paths that already expose pagination in the same runtime and schema area. (role: adjacent Feishu drive contributor; confidence: medium; commits: 1b94e8ca14de, ce0ff42ff5ed; files: extensions/feishu/src/drive.ts, extensions/feishu/src/drive-schema.ts)
  • ZengWen-DT: Recent sibling Feishu wiki pagination work fixed the same has_more and cursor class for wiki list surfaces. (role: adjacent pagination fix author; confidence: medium; commits: 5f90f0895750; files: extensions/feishu/src/wiki.ts, extensions/feishu/src/wiki-schema.ts)
  • steipete: Path history shows prior merged Feishu helper and account-routing refactors by this contributor before this replacement PR. (role: recent area contributor; confidence: medium; commits: 54cd8ed25be6, 38e4fb36426c, 125dc322f5c5; files: extensions/feishu/src/drive.ts)
  • Sliverp: CONTRIBUTING.md lists this person for Chinese channel areas including Feishu, which makes them a useful routing candidate for Feishu-specific behavior questions. (role: listed Feishu area routing candidate; confidence: medium; files: CONTRIBUTING.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 7, 2026
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the clean four-file replacement #101572, landed as commit 69b9932fae45423e5ee6b391406a3f09eb466a4c.

The verified GitHub commit path appended the rebased tree to this branch instead of rewriting its history, leaving stale merge-base files visible to review and the release-owned changelog gate. #101572 recreated the same reviewed code from current main in one co-authored commit and passed exact-head AWS plus hosted CI before landing.

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

Labels

app: android App: android channel: feishu Channel integration: feishu gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant