fix(ui): remove ignored session list limit option

Narrow fetchSessions to the reset option now that project session loading uses a fixed scoped request. This removes the stale getSessionFetchLimit call path so callers no longer imply cursor or offset pagination is still supported.

Validated with npm run typecheck --workspace packages/ui and node --test packages/ui/src/stores/session-pagination.test.ts.
This commit is contained in:
Shantur Rathore 2026-06-19 16:10:28 +01:00
parent eb9694880f
commit 8ff9ed1adb
4 changed files with 2 additions and 10 deletions

View file

@ -47,7 +47,6 @@ import {
clearActiveParentSession,
createSession,
fetchSessions,
getSessionFetchLimit,
updateSessionAgent,
updateSessionModel,
} from "./stores/sessions"
@ -419,7 +418,7 @@ const App: Component = () => {
clearActiveParentSession(instanceId)
try {
await fetchSessions(instanceId, { reset: true, limit: getSessionFetchLimit(instanceId) })
await fetchSessions(instanceId, { reset: true })
} catch (error) {
log.error("Failed to refresh sessions after closing", error)
}

View file

@ -191,7 +191,7 @@ async function ensureV2ParentChainsLoaded(instanceId: string, apiSessions: SDKSe
})
}
async function fetchSessions(instanceId: string, options?: { limit?: number; reset?: boolean }): Promise<void> {
async function fetchSessions(instanceId: string, options?: { reset?: boolean }): Promise<void> {
const instance = instances().get(instanceId)
if (!instance || !instance.client) {
throw new Error("Instance not ready")

View file

@ -85,10 +85,6 @@ function getSessionListIds(instanceId: string): string[] {
return getSessionPaginationState(instanceId).ids
}
function getSessionFetchLimit(instanceId: string): number {
return Math.max(getSessionPaginationState(instanceId).ids.length, SESSION_PAGE_SIZE)
}
function getSessionNextCursor(instanceId: string): string | undefined {
return getSessionPaginationState(instanceId).nextCursor
}
@ -1070,7 +1066,6 @@ export {
sessionPagination,
sessionSearch,
getSessionListIds,
getSessionFetchLimit,
getSessionNextCursor,
setSessionPage,
getSessionHasMore,

View file

@ -43,7 +43,6 @@ import {
setSessionStatus,
toggleSessionParentExpanded,
clearSessionSearch,
getSessionFetchLimit,
getSessionHasMore,
isSessionSearchLoading,
resetSessionPagination,
@ -161,7 +160,6 @@ export {
updateSessionAgent,
updateSessionModel,
clearSessionSearch,
getSessionFetchLimit,
getSessionHasMore,
isSessionSearchLoading,
resetSessionPagination,