From 8ff9ed1adbcb3feb540916fc675adb7dfbfc70d8 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Fri, 19 Jun 2026 16:10:28 +0100 Subject: [PATCH] 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. --- packages/ui/src/App.tsx | 3 +-- packages/ui/src/stores/session-api.ts | 2 +- packages/ui/src/stores/session-state.ts | 5 ----- packages/ui/src/stores/sessions.ts | 2 -- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/ui/src/App.tsx b/packages/ui/src/App.tsx index bb2689cf..866a896b 100644 --- a/packages/ui/src/App.tsx +++ b/packages/ui/src/App.tsx @@ -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) } diff --git a/packages/ui/src/stores/session-api.ts b/packages/ui/src/stores/session-api.ts index e35492e6..98ea2065 100644 --- a/packages/ui/src/stores/session-api.ts +++ b/packages/ui/src/stores/session-api.ts @@ -191,7 +191,7 @@ async function ensureV2ParentChainsLoaded(instanceId: string, apiSessions: SDKSe }) } -async function fetchSessions(instanceId: string, options?: { limit?: number; reset?: boolean }): Promise { +async function fetchSessions(instanceId: string, options?: { reset?: boolean }): Promise { const instance = instances().get(instanceId) if (!instance || !instance.client) { throw new Error("Instance not ready") diff --git a/packages/ui/src/stores/session-state.ts b/packages/ui/src/stores/session-state.ts index 5bca9e95..eb9cf36a 100644 --- a/packages/ui/src/stores/session-state.ts +++ b/packages/ui/src/stores/session-state.ts @@ -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, diff --git a/packages/ui/src/stores/sessions.ts b/packages/ui/src/stores/sessions.ts index 365fa8c3..a4239318 100644 --- a/packages/ui/src/stores/sessions.ts +++ b/packages/ui/src/stores/sessions.ts @@ -43,7 +43,6 @@ import { setSessionStatus, toggleSessionParentExpanded, clearSessionSearch, - getSessionFetchLimit, getSessionHasMore, isSessionSearchLoading, resetSessionPagination, @@ -161,7 +160,6 @@ export { updateSessionAgent, updateSessionModel, clearSessionSearch, - getSessionFetchLimit, getSessionHasMore, isSessionSearchLoading, resetSessionPagination,