Skip to content

api: paginate list RPCs with page tokens - #656

Merged
yongruilin merged 1 commit into
google:mainfrom
yongruilin:ax-aip-pagination
Nov 19, 2026
Merged

yongruilin merged 1 commit into
google:mainfrom
yongruilin:ax-aip-pagination

Conversation

@yongruilin

Copy link
Copy Markdown
Collaborator

Paginate the four List RPCs with page_size, page_token and next_page_token instead of limit and offset (AIP-158, item 3 of #563 (comment)).

  • ax get follows the tokens and prints every row; it used to stop at 50 tasks or workspaces.
  • A page holds 50 by default and at most 1000; the token wraps an offset, so the stores are unchanged and a write between two pages can repeat or skip a row.
  • An older ax against the new server lists the first 50 of each kind, which is new for gateways and models.

Follow-up: page by key in the stores, as Agent Substrate does.

All four lists take page_size and page_token and return next_page_token,
replacing limit and offset on tasks and workspaces. `ax get` follows the
tokens instead of stopping at 50.

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks Yongrui! Good to get this in before the rc so the list API doesn't change after. Heads up that studio sets Limit on ListTasks and ListWorkspaces, so the studio go.mod refresh will need a small switch to PageSize. @YoyinZyc could you pick that up once this lands?

@YoyinZyc

Copy link
Copy Markdown
Collaborator

sure

@yongruilin
yongruilin merged commit 749fa9c into google:main Nov 19, 2026
12 checks passed
mayawang pushed a commit to agentexecutor/studio that referenced this pull request Nov 20, 2026
AX now pages the four List RPCs with page_size, page_token and
next_page_token instead of limit and offset (google/ax#656), and a page
holds 50 resources unless more are asked for. Studio builds against that
AX, asks for 500 at a time and follows the page tokens to the last page,
as `ax get` does.

Gateways and models were listed with no size, so against the new server
Studio showed only the first 50 of each. Tasks and workspaces stopped at
500.

Also redraw the layers under "Where agents run" when setup moves to its
next stage, so they show the stage it is at.
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.

3 participants