feat: add pagination and server side search to list agents - #684
feat: add pagination and server side search to list agents#684sr07asthana wants to merge 14 commits into
Conversation
🦋 Changeset detectedLatest commit: 359e637 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ge and navigation controls. Update related API interactions to support paged mode and adjust tests accordingly.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a6cc087. Configure here.
| setLoadingMore(true); | ||
|
|
||
| void server | ||
| .searchAgents({ query: searchQuery, limit, offset }) |
There was a problem hiding this comment.
Full last page enables Next
Medium Severity
Paged mode treats a full page (rows.length >= limit) as another page, but listAgentsPage drops the SDK hasNextPage signal. When the last page is exactly full, Next stays enabled and opens an empty “No Agents Found” page.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit a6cc087. Configure here.
…gination. Update pagination implementation for the Agents API to include rows-per-page and navigation controls.
Prefer const for the SDK page cursor, align pagination drain tests with the new limit, and return helper agents without a query filter so findAgentByName resolution works. Co-authored-by: Cursor <cursoragent@cursor.com>


Summary
Closes #
Changes
How was this tested?
Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changedNote
Medium Risk
Breaking change for API/SDK consumers (
paginationrequired,listreturn type). Pagination and auth-scoped listing touch core agent registry paths; invalid tokens are rejected with 400.Overview
GET /api/v1/agentsis now token-paginated (defaultlimit25, max 25) with a requiredpaginationenvelope onListAgentsResponse, plus optionalagent_namesubstring filtering and 400 on bad tokens. Postgres/SQLite agent stores andlistAccessibleAgentsreturn{ data, pagination }using offset-based page tokens.The SDK
agents.listacceptsListAgentsRequestand returns aPage(withBadRequestErroron 400). OpenAPI/docs/changeset are updated accordingly.The Agents library drops infinite scroll for prev/next rows-per-page via
useSearchAgentsListpagedmode andTableTokenPagination. The harness adapter walks SDK pages (listAgentsPage/drainAgentsList) to honor UI offset/limit; name search in the library is still client-side on each fetched page (the newagent_namequery param is not wired throughsearchAgentsyet). Default list page size moves from 50 → 25.Reviewed by Cursor Bugbot for commit 359e637. Bugbot is set up for automated code reviews on this repo. Configure here.