feat(acp): paginate session list#9199
Conversation
add keyset pagination for acp session/list using a fixed server page size and opaque cursors. filter cwd and nonempty sessions before paging so nextcursor reflects the visible result set. Signed-off-by: Kalvin Chau <kalvin@block.xyz>
e544d56 to
fdfcffb
Compare
|
thanks -- this PR is the right idea but I think we need to clean up a few things here before we merge:
moving I would also hash the filters into the cursor to make this more future proof when we want to add more to the filter -- like the session type. |
summary
implements acp pagination for
session/list, per https://agentclientprotocol.com/protocol/session-list#paginationnextCursorwhen more sessions are availablecursorfrom the previous responsecwdas an exact absolute-path filtercwd, and cursor/cwd mismatches withinvalid_paramsnotes
this is a behavioral change for acp clients:
session/list {}now returns the first page instead of every visible session.clients must follow
nextCursorto retrieve all sessions.the cursor stores both
updated_atandsession_idbecause goose timestamps can collide at second precision. this avoidsskipping or duplicating sessions when multiple rows share the same timestamp.