Skip to content

Report has_more and next_link on paged lists - #117

Merged
sionsmith merged 3 commits into
osodevops:mainfrom
aberoham:up/pagination-metadata
Oct 15, 2026
Merged

sionsmith merged 3 commits into
osodevops:mainfrom
aberoham:up/pagination-metadata

Conversation

@aberoham

Copy link
Copy Markdown
Contributor

List commands without --all-pages dropped @odata.nextLink, so 50 results looked like the whole collection. JSON output now says whether there is more.

Behaviour changes:

  • metadata.has_more, plus metadata.next_link when there is more. data is unchanged, and --all-pages reports false.
  • Human and plain output print a hint on stderr when results are truncated.
  • search and user resolve page separately and don't report it yet.

Review guide: one commit, 0c0ed40. The interesting parts are get_paged in src/api/client.rs and the envelope in src/output/mod.rs; the rest is mechanical.

Testing: two-page mock tests. Checked live with chat list --page-size 5.

https://claude.ai/code/session_01Hd5XXx9UkpLZpAAkvPPyUg

aberoham and others added 3 commits October 11, 2026 19:19
List commands without --all-pages fetched one page and printed it with
success true, discarding Graph's @odata.nextLink. A caller could not
tell a complete collection from a truncated one, nor resume: `teams chat
list --page-size 1` looked the same whether one chat existed or fifty.

get_paged and get_paged_without_top now return a Page { items,
next_link }; list API wrappers pass it through and CLI list commands
print it with output::print_success_page. JSON metadata gains has_more
and, when true, next_link (the existing, previously unused field).
--all-pages gives has_more false. data is unchanged. Human and plain
output print "More results available; use --all-pages" on stderr, so
stdout stays parseable. Envelope docs (README, docs/README.md,
teams-agent-contract.7) describe the fields.

Tests: wiremock tests of get_paged for a truncated page (next_link
kept), the last page (none) and --all-pages (links followed, none);
output tests for has_more/next_link in the envelope and for data
matching the plain list envelope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hd5XXx9UkpLZpAAkvPPyUg
@sionsmith
sionsmith merged commit 9001d36 into osodevops:main Oct 15, 2026
6 checks passed
@sionsmith sionsmith mentioned this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants