mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-08-10 17:03:36 +00:00
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:
parent
eb9694880f
commit
8ff9ed1adb
4 changed files with 2 additions and 10 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import {
|
|||
setSessionStatus,
|
||||
toggleSessionParentExpanded,
|
||||
clearSessionSearch,
|
||||
getSessionFetchLimit,
|
||||
getSessionHasMore,
|
||||
isSessionSearchLoading,
|
||||
resetSessionPagination,
|
||||
|
|
@ -161,7 +160,6 @@ export {
|
|||
updateSessionAgent,
|
||||
updateSessionModel,
|
||||
clearSessionSearch,
|
||||
getSessionFetchLimit,
|
||||
getSessionHasMore,
|
||||
isSessionSearchLoading,
|
||||
resetSessionPagination,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue