feat(list): cursor pagination for all kb.list_* methods#264
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
d585245 to
2a1eaf5
Compare
|
@plind-junior , ready for review |
|
@plind-junior , same for this as well |
Fixes #245
What
All six
kb.list_*methods now support cursor pagination. Clients passlimitandcursorparams; responses return a{items, _meta}envelope withnext_cursorandtotal.Changes
storage.py
_paginate_pathshelper — id-ordered path slicing shared by all paged variantslist_claims_page,list_pages_page,list_entities_page,list_relations_page,list_sources_page,list_proposals_pagejsonl_server.py
_resolve_list_limit(readsretrieval.default_limitfrom config.yaml, falls back to 10)_paged_envelopebuilder_h_list_*handlers to use paged storage methods and return{items, _meta}envelopeserver.py
kb_list_*toolslimit: int | Noneandcursor: str | Noneparamstests/test_list_pagination.py (new file, 12 tests)
Deprecation
Flat-array response shape is deprecated. A
_meta.deprecationnotice is included in every response. Clients that currently doresult[0]orlen(result)on list responses need to update toresult["items"][0]andlen(result["items"]).Checklist