Skip to content

perf(webapp): clamp list-endpoint page size to 100#4360

Merged
ericallam merged 1 commit into
mainfrom
fix/cap-list-page-size-tri-12431
Jul 24, 2026
Merged

perf(webapp): clamp list-endpoint page size to 100#4360
ericallam merged 1 commit into
mainfrom
fix/cap-list-page-size-tri-12431

Conversation

@ericallam

@ericallam ericallam commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

Several list endpoints accepted an unbounded page size (perPage / per_page / pageSize). An unbounded page lets one request pull an arbitrarily large result set and do a proportional amount of work, which is a poor default for a shared API.

This clamps the page size to 100 on every list endpoint that was uncapped, matching the existing cap on api.v1.runs and api.v1.sessions. Clamping rather than rejecting keeps existing clients working: a request for a larger page returns up to 100 items and offset pagination continues from there.

Endpoints capped

  • api.v1.schedules (perPage)
  • api.v1.queues (perPage)
  • resources.…versions (per_page)
  • resources.…queues (per_page)
  • admin.api.v1.…engine.report (per_page)
  • admin.api.v1.llm-models (pageSize)

Already capped, left as-is: api.v1.runs, api.v1.sessions, api.v1.deployments.

@changeset-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 55f68d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

List pagination handling was updated across admin, API, and resource routes. Requested page sizes are validated as positive values where applicable and capped at 100. Existing defaults remain for routes that define them, and the LLM model loader now also enforces a minimum page size. A change notice documents the capped list endpoint behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers the change, but it omits required template sections like Closes #issue, checklist, testing, changelog, and screenshots. Add the missing template sections: Closes #, checklist items, testing steps, a changelog note, and screenshots or a clear placeholder if none.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: capping list-endpoint page sizes at 100.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cap-list-page-size-tri-12431

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ericallam
ericallam marked this pull request as ready for review July 24, 2026 10:27

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Several list endpoints accepted an unbounded page size. Clamp perPage /
per_page / pageSize to 100 on the schedules, queues, versions, engine-report,
and llm-models endpoints, matching the existing cap on the runs and sessions
endpoints. Oversized requests now return up to 100 items and keep paginating
instead of pulling an unbounded page.
@ericallam
ericallam force-pushed the fix/cap-list-page-size-tri-12431 branch from 350c680 to 55f68d2 Compare July 24, 2026 10:30
@ericallam
ericallam merged commit 7188eec into main Jul 24, 2026
32 checks passed
@ericallam
ericallam deleted the fix/cap-list-page-size-tri-12431 branch July 24, 2026 10:57
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