feat: add auto-pagination to messages search and update lark-im docs#30
Merged
liangshuo-1 merged 2 commits intolarksuite:mainfrom Mar 30, 2026
Merged
Conversation
Change-Id: Ic50e891d2385c2e3ac902cd89d95c3db99f94050
liangshuo-1
approved these changes
Mar 30, 2026
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
=======================================
Coverage ? 48.31%
=======================================
Files ? 280
Lines ? 23056
Branches ? 0
=======================================
Hits ? 11139
Misses ? 10921
Partials ? 996 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tuxedomm
pushed a commit
that referenced
this pull request
Apr 3, 2026
…30) Change-Id: Ic50e891d2385c2e3ac902cd89d95c3db99f94050
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
This PR adds auto-pagination support to
im +messages-searchand updates the related lark-im docs to match the new behavior.The change keeps the default behavior unchanged for existing users:
--page-all--page-limit <n>Background
im +messages-searchpreviously returned only a single page of results unless callers manually resumed with--page-token.That was workable for simple lookups, but it was awkward for:
This PR addresses that gap while preserving backward compatibility.
What Changed
1. Add auto-pagination to
im +messages-searchNew flags:
--page-all--page-limit <n>Behavior:
--page-allenables auto-pagination with a max cap of 40 pages--page-limit <n>enables auto-pagination with an explicit cap--page-limitwithout--page-allstill enables auto-paginationhas_more/page_tokenso callers can resume manually2. Keep large follow-up fetches batched
Search execution now:
messages/mgetin chunks of up to 50 IDschats/batch_queryin chunks of up to 50 chat IDsThis keeps the implementation aligned with downstream API limits and makes multi-page search results usable in practice.
3. Improve dry-run / help text
Dry-run output now reflects:
Shortcut description and help text were also updated to mention:
4. Update lark-im docs
Updated:
skills/lark-im/SKILL.mdskills/lark-im/references/lark-im-messages-search.mdDocs now cover:
--page-all/--page-limitAlso corrected the p2p field description to match current implementation:
chat_nameis documented for group chatschat_partnerfor p2p is documented as containingopen_idCompatibility / Behavior Notes
--page-tokencontinues to work.--page-limitis validated as an integer in the range1..40.Tests
Added / updated coverage for:
--page-limitvalidationmgetcallsbatch_querycalls--page-limitwithout--page-allTest command: