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.
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.