-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: feat(gateway): apply cursor pagination to agents.files.list and sessions.list #75236
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Summary
artifacts.list gained cursor pagination in #75208 via src/gateway/util/cursor.ts.
The same pattern should be applied to agents.files.list and sessions list RPCs
to keep the API surface consistent.
Refs #75208.
Problem to solve
agents.files.list and sessions list RPCs return unbounded result sets.
Large workspaces with many files or sessions have no way to paginate results efficiently.
Proposed solution
Import encodeCursor/decodeCursor from src/gateway/util/cursor.ts (introduced in #75208)
and add cursor, limit, nextCursor, total to agents.files.list and sessions list params/results,
following the same pattern as artifacts.list.
Alternatives considered
No response
Impact
Affected: SDK consumers and agents using agents.files.list or sessions RPCs
Severity: Medium
Frequency: Any workspace with large file sets or many sessions
Consequence: Unbounded payloads, slow responses, no way to paginate
Evidence/examples
artifacts.list already supports cursor pagination via #75208.
agents.files.list and sessions list have no equivalent.
Additional information
Reuse src/gateway/util/cursor.ts introduced in #75208. No new dependencies needed.