From 09f181c577f84b2c5257fadb6f7ab1cfcb24e34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E5=9F=BA=E9=AD=81?= <56265583+fengjikui@users.noreply.github.com> Date: Wed, 24 Jun 2026 14:19:06 +0800 Subject: [PATCH] fix(server): fetch filtered dashboard memories beyond default page (#5753) --- .../app/(root)/dashboard/memories/page.tsx | 8 ++++-- server/main.py | 10 +++++--- tests/test_server_params.py | 25 +++++++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/server/dashboard/src/app/(root)/dashboard/memories/page.tsx b/server/dashboard/src/app/(root)/dashboard/memories/page.tsx index 66f95447b..a7419ca5d 100644 --- a/server/dashboard/src/app/(root)/dashboard/memories/page.tsx +++ b/server/dashboard/src/app/(root)/dashboard/memories/page.tsx @@ -27,6 +27,8 @@ import { useApiQuery } from "@/hooks/use-api-query"; import { Memory } from "@/types/api"; const PAGE_SIZE = 20; +// Keep in sync with ALL_MEMORIES_LIMIT in server/main.py. +const MEMORY_FETCH_LIMIT = 1000; export default function MemoriesPage() { const [userId, setUserId] = useState(""); @@ -41,7 +43,9 @@ export default function MemoriesPage() { refetch, } = useApiQuery( async () => { - const params = userId.trim() ? { user_id: userId.trim() } : undefined; + const params = userId.trim() + ? { user_id: userId.trim(), top_k: MEMORY_FETCH_LIMIT } + : { top_k: MEMORY_FETCH_LIMIT }; const res = await api.get(MEMORY_ENDPOINTS.BASE, { params }); const raw = res.data?.results ?? res.data ?? []; return Array.isArray(raw) ? raw : []; @@ -96,7 +100,7 @@ export default function MemoriesPage() {

Memories

- {memories.length >= 1000 && ( + {memories.length >= MEMORY_FETCH_LIMIT && (