diff --git a/apps/webapp/app/components/runs/v3/AIFilterInput.tsx b/apps/webapp/app/components/runs/v3/AIFilterInput.tsx index f2a01d27c6c..635fece4c6d 100644 --- a/apps/webapp/app/components/runs/v3/AIFilterInput.tsx +++ b/apps/webapp/app/components/runs/v3/AIFilterInput.tsx @@ -38,7 +38,7 @@ export function AIFilterInput() { const fetcher = useFetcher(); useEffect(() => { - if (fetcher.data?.success && fetcher.state === "loading") { + if (fetcher.data?.success && fetcher.state === "idle") { setText(""); setIsFocused(false); diff --git a/apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx b/apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx index e42a2122abe..5d965bd4b7a 100644 --- a/apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx +++ b/apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx @@ -93,7 +93,7 @@ function ReplayContent({ runFriendlyId, failedRedirect }: ReplayRunDialogProps) }/env/${envSlug}/queues?${searchParams.toString()}` ); } - }, [params.organizationSlug, params.projectParam, params.envParam, environmentIdOverride]); + }, [params.organizationSlug, params.projectParam, params.envParam, environmentIdOverride, replayDataFetcher.data]); const customQueues = useMemo(() => { return queueFetcher.data?.queues ?? []; diff --git a/apps/webapp/app/components/runs/v3/agent/AgentView.tsx b/apps/webapp/app/components/runs/v3/agent/AgentView.tsx index cbe5cec8f3c..99031918736 100644 --- a/apps/webapp/app/components/runs/v3/agent/AgentView.tsx +++ b/apps/webapp/app/components/runs/v3/agent/AgentView.tsx @@ -554,6 +554,15 @@ function useAgentSessionMessages({ }; }, [sessionId, apiOrigin, orgSlug, projectSlug, envSlug, snapshotPresignedUrl]); + // Reset refs when session changes to prevent stale data from bleeding + // across sessions (e.g. navigating between runs with different agent sessions) + useEffect(() => { + pendingRef.current = new Map(seedMessages.map((m) => [m.id, m])); + timestampsRef.current = new Map(seedMessages.map((m) => [m.id, INITIAL_PAYLOAD_TIMESTAMP])); + orchestrationRef.current = new Map(); + setMessagesById(new Map(pendingRef.current)); + }, [sessionId, seedMessages]); + return useMemo(() => { const timestamps = timestampsRef.current; const arr = Array.from(messagesById.values()); diff --git a/apps/webapp/app/presenters/v3/LogsListPresenter.server.ts b/apps/webapp/app/presenters/v3/LogsListPresenter.server.ts index 517c586e4e7..18022c86fd2 100644 --- a/apps/webapp/app/presenters/v3/LogsListPresenter.server.ts +++ b/apps/webapp/app/presenters/v3/LogsListPresenter.server.ts @@ -215,12 +215,6 @@ export class LogsListPresenter extends BasePresenter { ); } - if (store === EVENT_STORE_TYPES.CLICKHOUSE) { - throw new ServiceValidationError( - "Logs are not available for ClickHouse event store. Please contact support." - ); - } - const queryBuilder = this.clickhouse.taskEventsSearch.logsListQueryBuilder(); // This should be removed once we clear the old inserts, 30 DAYS, the materialized view excludes events without trace_id)