Skip to content

feat: add pagination and server side search to list agents - #684

Open
sr07asthana wants to merge 14 commits into
mainfrom
sr-AGE-2158
Open

feat: add pagination and server side search to list agents#684
sr07asthana wants to merge 14 commits into
mainfrom
sr-AGE-2158

Conversation

@sr07asthana

@sr07asthana sr07asthana commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #

Changes

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Breaking change for API/SDK consumers (pagination required, list return type). Pagination and auth-scoped listing touch core agent registry paths; invalid tokens are rejected with 400.

Overview
GET /api/v1/agents is now token-paginated (default limit 25, max 25) with a required pagination envelope on ListAgentsResponse, plus optional agent_name substring filtering and 400 on bad tokens. Postgres/SQLite agent stores and listAccessibleAgents return { data, pagination } using offset-based page tokens.

The SDK agents.list accepts ListAgentsRequest and returns a Page (with BadRequestError on 400). OpenAPI/docs/changeset are updated accordingly.

The Agents library drops infinite scroll for prev/next rows-per-page via useSearchAgentsList paged mode and TableTokenPagination. 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 new agent_name query param is not wired through searchAgents yet). 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.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 359e637

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@truefoundry/trueforge Patch
@truefoundry/trueforge-ui Patch
@truefoundry/trueforge-sdk Patch

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread packages/trueforge/src/apis/agents.ts
…ge and navigation controls. Update related API interactions to support paged mode and adjust tests accordingly.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ 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 })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a6cc087. Configure here.

govindavashishtha and others added 4 commits September 10, 2026 19:43
…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>
@sr07asthana sr07asthana changed the title feat: add pagination to list agents feat: add pagination and server side search to list agents Sep 10, 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