From 101d76215dd72a13fdf378378a062d7edd12a46c Mon Sep 17 00:00:00 2001 From: moe-berri Date: Tue, 6 Oct 2026 15:10:42 -0700 Subject: [PATCH] fix(lens): serialize conversation paging with content refresh --- .../conversation/TraceConversation.integration.test.tsx | 4 ++++ .../src/components/lens/traces/detail/run/RunView.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/lens/traces/detail/conversation/TraceConversation.integration.test.tsx b/ui/litellm-dashboard/src/components/lens/traces/detail/conversation/TraceConversation.integration.test.tsx index 0d51387bbb2..884cd0d5304 100644 --- a/ui/litellm-dashboard/src/components/lens/traces/detail/conversation/TraceConversation.integration.test.tsx +++ b/ui/litellm-dashboard/src/components/lens/traces/detail/conversation/TraceConversation.integration.test.tsx @@ -154,6 +154,7 @@ describe("TraceConversation", () => { it("keeps refresh busy until content finishes when live updates pause", async () => { const user = userEvent.setup(); const pending = Promise.withResolvers(); + vi.mocked(agentTraceCall).mockResolvedValue({ ...trace, next_cursor: "next-page" }); renderWithProviders( , ); @@ -166,11 +167,14 @@ describe("TraceConversation", () => { await user.click(refresh); await waitFor(() => expect(testQueryClient.isFetching({ queryKey: ["agentTrace"] })).toBe(0)); expect(refresh).toBeDisabled(); + const more = screen.getByRole("button", { name: "Load next 20 entries" }); + expect(more).toBeDisabled(); await user.click(refresh); await user.click(screen.getByRole("button", { name: "Live updates" })); await act(async () => pending.resolve({ ...rootDetail, output: "Updated final answer" })); expect(await screen.findByText("Updated final answer")).toBeVisible(); await waitFor(() => expect(refresh).toBeEnabled()); + expect(more).toBeEnabled(); expect(agentTraceCall).toHaveBeenCalledTimes(2); }); diff --git a/ui/litellm-dashboard/src/components/lens/traces/detail/run/RunView.tsx b/ui/litellm-dashboard/src/components/lens/traces/detail/run/RunView.tsx index a0bbf156912..12ff750f95c 100644 --- a/ui/litellm-dashboard/src/components/lens/traces/detail/run/RunView.tsx +++ b/ui/litellm-dashboard/src/components/lens/traces/detail/run/RunView.tsx @@ -196,7 +196,7 @@ function LoadedRun({ embedded={embedded} stale={switching} conversationPaging={{ - loading: traceQuery.isFetching, + loading: manualRead || traceQuery.isFetching, failed: isFetchNextPageError, loadMore: fetchNextPage, }}