Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(dataset-compare): adjust trace query to include timestamp and disable retries (#11743)

marliessophied1754b8d5243
diff --git a/web/src/features/datasets/components/DatasetAggregateTableCell.tsx b/web/src/features/datasets/components/DatasetAggregateTableCell.tsx
index ab421c4ddd..ae16105c5a 100644
--- a/web/src/features/datasets/components/DatasetAggregateTableCell.tsx
+++ b/web/src/features/datasets/components/DatasetAggregateTableCell.tsx
@@ -52,19 +52,20 @@ const DatasetAggregateCellContent = ({
// Merge server columns with cache-only columns
const mergedScoreColumns = useMergeScoreColumns(serverScoreColumns);
+ // Subtract 1 day from the run item creation timestamp as a buffer in case the trace happened before the run
+ const fromTimestamp = new Date(
+ value.createdAt.getTime() - 24 * 60 * 60 * 1000,
+ );
+
// conditionally fetch the trace or observation depending on the presence of observationId
const trace = api.traces.byId.useQuery(
- { traceId: value.trace.id, projectId },
+ { traceId: value.trace.id, projectId, fromTimestamp },
{
enabled: value.observation === undefined,
- trpc: {
- context: {
- skipBatch: true,
- },
- },
refetchOnMount: false,
refetchOnWindowFocus: false,
refetchOnReconnect: false,
+ retry: false,
staleTime: Infinity,
meta: { silentHttpCodes },
},
@@ -77,14 +78,10 @@ const DatasetAggregateCellContent = ({
},
{
enabled: value.observation !== undefined,
- trpc: {
- context: {
- skipBatch: true,
- },
- },
refetchOnMount: false,
refetchOnWindowFocus: false,
refetchOnReconnect: false,
+ retry: false,
staleTime: Infinity,
meta: { silentHttpCodes },
},