Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(replay-vision): add date filtering to observations list (#72390)

Hayne Ryu35ae48c88941
diff --git a/products/replay_vision/backend/api/observations.py b/products/replay_vision/backend/api/observations.py
index c746b45bcd39..f0b037064646 100644
--- a/products/replay_vision/backend/api/observations.py
+++ b/products/replay_vision/backend/api/observations.py
@@ -1,5 +1,6 @@
import uuid
from typing import Any, cast, get_args
+from zoneinfo import ZoneInfo
from django.conf import settings
from django.db.models import Case, CharField, FloatField, Func, IntegerField, Q, QuerySet, Value, When
@@ -23,6 +24,7 @@ from posthog.api.shared import UserBasicSerializer
from posthog.api.streaming import sse_streaming_response
from posthog.models.user import User
from posthog.renderers import ServerSentEventRenderer
+from posthog.utils import relative_date_parse
from products.replay_vision.backend.api.filters import MultiChoiceFilter, OrderByFilter, ordering_enum
from products.replay_vision.backend.api.observation_progress import stream_observation_progress
@@ -487,6 +489,17 @@ class ReplayObservationFilter(django_filters.FilterSet):
lookup_expr="icontains",
help_text="Filter to observations whose person email contains this value (case-insensitive).",
)
+ date_from = django_filters.CharFilter(
+ method="_filter_date_from",
+ help_text="Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.",
+ )
+ date_to = django_filters.CharFilter(
+ method="_filter_date_to",
+ help_text=(
+ "Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; "
+ "date-only values include the whole day."
+ ),
+ )
labeled = django_filters.BooleanFilter(
method="_filter_labeled",
help_text=(
@@ -527,6 +540,20 @@ class ReplayObservationFilter(django_filters.FilterSet):
) -> QuerySet[ReplayObservation]:
return queryset.filter(label__isnull=not value)
+ def _filter_date_from(
+ self, queryset: QuerySet[ReplayObservation], _name: str, value: str
+ ) -> QuerySet[ReplayObservation]:
+ return queryset.filter(created_at__gte=relative_date_parse(value, ZoneInfo("UTC")))
+
+ def _filter_date_to(
+ self, queryset: QuerySet[ReplayObservation], _name: str, value: str
+ ) -> QuerySet[ReplayObservation]:
+ parsed = relative_date_parse(value, ZoneInfo("UTC"))
+ # Date-only values include the whole day; relative values stay exact.
+ if not value.startswith(("-", "+")) and "T" not in value and ":" not in value:
+ parsed = parsed.replace(hour=23, minute=59, second=59, microsecond=999999)
+ return queryset.filter(created_at__lte=parsed)
+
def _filter_tags(
self, queryset: QuerySet[ReplayObservation], _name: str, value: str
) -> QuerySet[ReplayObservation]:
diff --git a/products/replay_vision/backend/tests/test_api.py b/products/replay_vision/backend/tests/test_api.py
index df79ac260975..cb187c939e7e 100644
--- a/products/replay_vision/backend/tests/test_api.py
+++ b/products/replay_vision/backend/tests/test_api.py
@@ -864,6 +864,25 @@ class TestReplayObservationViewSet(_VisionAPITestCase):
defaults.update(overrides)
return ReplayObservation.objects.create(**defaults)
+ def test_list_filters_by_date_range(self) -> None:
+ self._create_observation(session_id="recent")
+ old = self._create_observation(session_id="old")
+ ReplayObservation.objects.filter(pk=old.pk).update(created_at=timezone.now() - timedelta(days=10))
+
+ resp = self.client.get(f"{self.observations_url(str(self.scanner.id))}?date_from=-7d")
+ self.assertEqual(resp.status_code, 200, resp.json())
+ self.assertEqual([r["session_id"] for r in resp.json()["results"]], ["recent"])
+
+ old_day = (timezone.now() - timedelta(days=10)).strftime("%Y-%m-%d")
+ resp = self.client.get(f"{self.observations_url(str(self.scanner.id))}?date_from={old_day}&date_to={old_day}")
+ self.assertEqual(resp.status_code, 200, resp.json())
+ self.assertEqual([r["session_id"] for r in resp.json()["results"]], ["old"])
+
+ # Relative date_to stays an exact bound instead of extending to end of day.
+ resp = self.client.get(f"{self.observations_url(str(self.scanner.id))}?date_to=-1h")
+ self.assertEqual(resp.status_code, 200, resp.json())
+ self.assertEqual([r["session_id"] for r in resp.json()["results"]], ["old"])
+
def test_retrieve_with_filters_resolves_object_and_scopes_neighbors_only(self) -> None:
observation = self._create_observation(session_id="s-pending")
self._create_observation(session_id="s-other")
diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.ts
index 1bca88f43d95..b183c1764a7a 100644
--- a/products/replay_vision/frontend/generated/api.schemas.ts
+++ b/products/replay_vision/frontend/generated/api.schemas.ts
@@ -1442,6 +1442,14 @@ export type VisionObservationsListParams = {
}
export type VisionObservationsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -1537,6 +1545,14 @@ export type VisionScannersImpactRetrieveParams = {
}
export type VisionScannersObservationsListParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -1580,6 +1596,14 @@ export type VisionScannersObservationsListParams = {
}
export type VisionScannersObservationsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -1615,6 +1639,14 @@ export type VisionScannersObservationsRetrieveParams = {
}
export type VisionScannersObservationsStatsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerObservationsTable.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerObservationsTable.tsx
index bd657ee9c0d1..a88199f8e1e2 100644
--- a/products/replay_vision/frontend/replay_scanners/components/ScannerObservationsTable.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerObservationsTable.tsx
@@ -4,11 +4,13 @@ import { IconEye, IconPlay, IconRefresh } from '@posthog/icons'
import { LemonButton, LemonInput, LemonTable, LemonTag, LemonTagType, Link, Tooltip } from '@posthog/lemon-ui'
import { AccessControlAction } from 'lib/components/AccessControlAction'
+import { DateFilter } from 'lib/components/DateFilter/DateFilter'
+import { CUSTOM_OPTION_KEY } from 'lib/components/DateFilter/types'
import { TZLabel } from 'lib/components/TZLabel'
import { LemonTableColumns } from 'lib/lemon-ui/LemonTable'
import { urls } from 'scenes/urls'
-import { AccessControlLevel, AccessControlResourceType } from '~/types'
+import { AccessControlLevel, AccessControlResourceType, DateMappingOption } from '~/types'
import { FilterPill } from '../../components/FilterPill'
import { ObservationResultSummary, ObservationStatusTag } from '../../components/ObservationCard'
@@ -42,6 +44,17 @@ const VERDICT_OPTIONS: { value: ObservationVerdictValue; label: string }[] = [
{ value: 'inconclusive', label: 'Inconclusive' },
]
+// Empty values on "All time" clear the range, matching the unfiltered default.
+const OBSERVATION_DATE_OPTIONS: DateMappingOption[] = [
+ { key: CUSTOM_OPTION_KEY, values: [] },
+ { key: 'All time', values: [] },
+ { key: 'Last 24 hours', values: ['-24h'] },
+ { key: 'Last 3 days', values: ['-3d'] },
+ { key: 'Last 7 days', values: ['-7d'] },
+ { key: 'Last 30 days', values: ['-30d'] },
+ { key: 'Last 90 days', values: ['-90d'] },
+]
+
// Chip color by how many versions behind the live scanner an observation ran: latest → oldest.
const VERSION_TAG_TYPES: LemonTagType[] = ['success', 'warning', 'caution', 'danger', 'completion']
@@ -94,6 +107,8 @@ export function ScannerObservationsTable({ scannerId }: { scannerId: string }):
observationVerdictFilter,
observationTagFilter,
observationSubjectFilter,
+ observationDateFrom,
+ observationDateTo,
hasActiveObservationFilters,
observationDetailLinkParams,
availableTags,
@@ -112,6 +127,7 @@ export function ScannerObservationsTable({ scannerId }: { scannerId: string }):
setObservationVerdictFilter,
setObservationTagFilter,
setObservationSubjectFilter,
+ setObservationDateRange,
clearObservationFilters,
} = useActions(logic)
const scannerType = scanner?.scanner_type
@@ -251,6 +267,13 @@ export function ScannerObservationsTable({ scannerId }: { scannerId: string }):
onChange={setObservationSubjectFilter}
className="w-56"
/>
+ <DateFilter
+ size="small"
+ dateFrom={observationDateFrom}
+ dateTo={observationDateTo}
+ dateOptions={OBSERVATION_DATE_OPTIONS}
+ onChange={(dateFrom, dateTo) => setObservationDateRange(dateFrom, dateTo)}
+ />
<FilterPill<ObservationStatusValue>
label="Status"
options={STATUS_OPTIONS}
diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
index 5b730b453e55..00a459f07ed9 100644
--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
@@ -372,6 +372,8 @@ describe('replayScannerLogic', () => {
observationVerdictFilter: [] as ObservationVerdictValue[],
observationTagFilter: [] as string[],
observationSubjectFilter: '',
+ observationDateFrom: null as string | null,
+ observationDateTo: null as string | null,
observationsSort: null,
scanner: null,
}
@@ -399,6 +401,15 @@ describe('replayScannerLogic', () => {
expect(params.tags).toBe('onboarding,support')
})
+ it('passes date range only when set', () => {
+ const params = buildObservationListParams({
+ ...emptyValues,
+ observationDateFrom: '-7d',
+ observationDateTo: '2026-07-01',
+ })
+ expect(params).toEqual({ date_from: '-7d', date_to: '2026-07-01' })
+ })
+
it.each<[ReplayScanner, string]>([
[scorerScanner, 'result_score'],
[monitorScanner, 'result_verdict'],
diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
index 401fe828567f..cd24b211b97c 100644
--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts
@@ -121,6 +121,8 @@ interface ObservationListParams {
verdict?: string
tags?: string
recording_subject?: string
+ date_from?: string
+ date_to?: string
order_by?: string
}
@@ -151,13 +153,21 @@ interface ObservationFilterValues {
observationVerdictFilter: ObservationVerdictValue[]
observationTagFilter: string[]
observationSubjectFilter: string
+ observationDateFrom: string | null
+ observationDateTo: string | null
}
/** The filter (non-pagination, non-sort) params shared by the list/stats endpoints and the URL query string. */
function observationFilterParams(
values: ObservationFilterValues
-): Pick<ObservationListParams, 'status' | 'triggered_by' | 'verdict' | 'tags' | 'recording_subject'> {
- const params: Pick<ObservationListParams, 'status' | 'triggered_by' | 'verdict' | 'tags' | 'recording_subject'> = {}
+): Pick<
+ ObservationListParams,
+ 'status' | 'triggered_by' | 'verdict' | 'tags' | 'recording_subject' | 'date_from' | 'date_to'
+> {
+ const params: Pick<
+ ObservationListParams,
+ 'status' | 'triggered_by' | 'verdict' | 'tags' | 'recording_subject' | 'date_from' | 'date_to'
+ > = {}
if (values.observationStatusFilter.length > 0) {
params.status = values.observationStatusFilter.join(',')
}
@@ -173,6 +183,12 @@ function observationFilterParams(
if (values.observationSubjectFilter.trim()) {
params.recording_subject = values.observationSubjectFilter.trim()
}
+ if (values.observationDateFrom) {
+ params.date_from = values.observationDateFrom
+ }
+ if (values.observationDateTo) {
+ params.date_to = values.observationDateTo
+ }
return params
}
@@ -233,6 +249,8 @@ export interface replayScannerLogicValues {
noTotal: number
yesTotal: number
}
+ observationDateFrom: string | null
+ observationDateTo: string | null
observationDetailLinkParams: Record<string, string>
observationStats: {
failed: number
@@ -392,6 +410,8 @@ export interface replayScannerLogicActions {
values?: ReplayScanner
}
restoreObservationsTableState: (state: {
+ dateFrom: string | null
+ dateTo: string | null
page: number
sort: ObservationsSorting | null
status: ObservationStatusValue[]
@@ -400,6 +420,8 @@ export interface replayScannerLogicActions {
triggeredBy: ObservationTriggeredByValue[]
verdict: ObservationVerdictValue[]
}) => {
+ dateFrom: string | null
+ dateTo: string | null
page: number
sort: ObservationsSorting | null
status: ObservationStatusEnumApi[]
@@ -452,6 +474,13 @@ export interface replayScannerLogicActions {
dateFrom: string | null
dateTo: string | null
}
+ setObservationDateRange: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ }
setObservationStatusFilter: (values: ObservationStatusValue[]) => {
values: ObservationStatusEnumApi[]
}
@@ -548,7 +577,9 @@ export interface replayScannerLogicMeta {
observationTriggeredByFilter: ObservationTriggerEnumApi[],
observationVerdictFilter: ObservationVerdictValue[],
observationTagFilter: string[],
- observationSubjectFilter: string
+ observationSubjectFilter: string,
+ observationDateFrom: string | null,
+ observationDateTo: string | null
) => boolean
observationDetailLinkParams: (
observationStatusFilter: ObservationStatusEnumApi[],
@@ -556,6 +587,8 @@ export interface replayScannerLogicMeta {
observationVerdictFilter: ObservationVerdictValue[],
observationTagFilter: string[],
observationSubjectFilter: string,
+ observationDateFrom: string | null,
+ observationDateTo: string | null,
observationsSort: ObservationsSorting | null,
scanner: ReplayScanner
) => Record<string, string>
@@ -640,6 +673,7 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
setObservationVerdictFilter: (values: ObservationVerdictValue[]) => ({ values }),
setObservationTagFilter: (values: string[]) => ({ values }),
setObservationSubjectFilter: (value: string) => ({ value }),
+ setObservationDateRange: (dateFrom: string | null, dateTo: string | null) => ({ dateFrom, dateTo }),
clearObservationFilters: true,
restoreObservationsTableState: (state: {
page: number
@@ -649,6 +683,8 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
verdict: ObservationVerdictValue[]
tags: string[]
subject: string
+ dateFrom: string | null
+ dateTo: string | null
}) => state,
setChartDateRange: (dateFrom: string | null, dateTo: string | null) => ({ dateFrom, dateTo }),
requestScannerEstimate: true,
@@ -931,6 +967,7 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
setObservationVerdictFilter: () => 1,
setObservationTagFilter: () => 1,
setObservationSubjectFilter: () => 1,
+ setObservationDateRange: () => 1,
setObservationsSort: () => 1,
clearObservationFilters: () => 1,
restoreObservationsTableState: (_, { page }) => Math.max(1, page),
@@ -1036,6 +1073,22 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
restoreObservationsTableState: (_, { subject }) => subject,
},
],
+ observationDateFrom: [
+ null as string | null,
+ {
+ setObservationDateRange: (_, { dateFrom }) => dateFrom,
+ clearObservationFilters: () => null,
+ restoreObservationsTableState: (_, { dateFrom }) => dateFrom,
+ },
+ ],
+ observationDateTo: [
+ null as string | null,
+ {
+ setObservationDateRange: (_, { dateTo }) => dateTo,
+ clearObservationFilters: () => null,
+ restoreObservationsTableState: (_, { dateTo }) => dateTo,
+ },
+ ],
chartDateFrom: ['-14d' as string | null, { setChartDateRange: (_, { dateFrom }) => dateFrom }],
chartDateTo: [null as string | null, { setChartDateRange: (_, { dateTo }) => dateTo }],
}),
@@ -1074,19 +1127,25 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
s.observationVerdictFilter,
s.observationTagFilter,
s.observationSubjectFilter,
+ s.observationDateFrom,
+ s.observationDateTo,
],
(
statusFilter: ObservationStatusValue[],
triggeredByFilter: ObservationTriggeredByValue[],
verdictFilter: ObservationVerdictValue[],
tagFilter: string[],
- subjectFilter: string
+ subjectFilter: string,
+ dateFrom: string | null,
+ dateTo: string | null
): boolean =>
statusFilter.length > 0 ||
triggeredByFilter.length > 0 ||
verdictFilter.length > 0 ||
tagFilter.length > 0 ||
- subjectFilter.trim().length > 0,
+ subjectFilter.trim().length > 0 ||
+ dateFrom !== null ||
+ dateTo !== null,
],
// Carried into observation detail links so server-computed prev/next neighbors honor the table's filters + sort.
observationDetailLinkParams: [
@@ -1096,6 +1155,8 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
s.observationVerdictFilter,
s.observationTagFilter,
s.observationSubjectFilter,
+ s.observationDateFrom,
+ s.observationDateTo,
s.observationsSort,
s.scanner,
],
@@ -1105,6 +1166,8 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
observationVerdictFilter: ObservationVerdictValue[],
observationTagFilter: string[],
observationSubjectFilter: string,
+ observationDateFrom: string | null,
+ observationDateTo: string | null,
observationsSort: ObservationsSorting | null,
scanner: ReplayScanner | null
): Record<string, string> =>
@@ -1114,6 +1177,8 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
observationVerdictFilter,
observationTagFilter,
observationSubjectFilter,
+ observationDateFrom,
+ observationDateTo,
observationsSort,
scanner,
}) as Record<string, string>,
@@ -1460,6 +1525,7 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
setObservationTriggeredByFilter: () => reloadObservationsAndStats(),
setObservationVerdictFilter: () => reloadObservationsAndStats(),
setObservationTagFilter: () => reloadObservationsAndStats(),
+ setObservationDateRange: () => reloadObservationsAndStats(),
setObservationSubjectFilter: async (_, breakpoint) => {
// Free-text search — debounce so typing doesn't fire a request per keystroke.
await breakpoint(300)
@@ -1538,6 +1604,7 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
setObservationTriggeredByFilter: writeUrl,
setObservationVerdictFilter: writeUrl,
setObservationTagFilter: writeUrl,
+ setObservationDateRange: writeUrl,
setObservationSubjectFilter: writeUrlReplace,
clearObservationFilters: writeUrl,
}
@@ -1560,6 +1627,8 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
// String() so a numeric-looking subject (`?recording_subject=12345`) survives the router's coercion.
const subject =
typeof subjectRaw === 'string' ? subjectRaw : typeof subjectRaw === 'number' ? String(subjectRaw) : ''
+ const dateFrom = typeof searchParams.date_from === 'string' ? searchParams.date_from : null
+ const dateTo = typeof searchParams.date_to === 'string' ? searchParams.date_to : null
const sameAsCurrent =
page === values.observationsPage &&
sort.columnKey === values.observationsSort?.columnKey &&
@@ -1568,9 +1637,21 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
objectsEqual(triggeredBy, values.observationTriggeredByFilter) &&
objectsEqual(verdict, values.observationVerdictFilter) &&
objectsEqual(tags, values.observationTagFilter) &&
- subject === values.observationSubjectFilter
+ subject === values.observationSubjectFilter &&
+ dateFrom === values.observationDateFrom &&
+ dateTo === values.observationDateTo
if (!sameAsCurrent) {
- actions.restoreObservationsTableState({ page, sort, status, triggeredBy, verdict, tags, subject })
+ actions.restoreObservationsTableState({
+ page,
+ sort,
+ status,
+ triggeredBy,
+ verdict,
+ tags,
+ subject,
+ dateFrom,
+ dateTo,
+ })
}
},
})),
@@ -1601,7 +1682,17 @@ export const replayScannerLogic = kea<replayScannerLogicType>([
}),
])
-const TABLE_URL_PARAM_KEYS = ['page', 'sort', 'status', 'triggered_by', 'verdict', 'tags', 'recording_subject'] as const
+const TABLE_URL_PARAM_KEYS = [
+ 'page',
+ 'sort',
+ 'status',
+ 'triggered_by',
+ 'verdict',
+ 'tags',
+ 'recording_subject',
+ 'date_from',
+ 'date_to',
+] as const
/** The three step URLs of a scanner's editor wizard. */
function scannerEditorPaths(scannerId: string): string[] {
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index f7a00ddb5194..7c085786fc7d 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -71241,6 +71241,14 @@ export namespace Schemas {
};
export type EnvironmentsVisionObservationsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string;
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string;
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -71336,6 +71344,14 @@ export namespace Schemas {
};
export type EnvironmentsVisionScannersObservationsListParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string;
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string;
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -71379,6 +71395,14 @@ export namespace Schemas {
};
export type EnvironmentsVisionScannersObservationsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string;
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string;
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -71414,6 +71438,14 @@ export namespace Schemas {
};
export type EnvironmentsVisionScannersObservationsStatsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string;
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string;
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -80227,6 +80259,14 @@ export namespace Schemas {
};
export type VisionObservationsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string;
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string;
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -80322,6 +80362,14 @@ export namespace Schemas {
};
export type VisionScannersObservationsListParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string;
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string;
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -80365,6 +80413,14 @@ export namespace Schemas {
};
export type VisionScannersObservationsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string;
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string;
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
@@ -80400,6 +80456,14 @@ export namespace Schemas {
};
export type VisionScannersObservationsStatsRetrieveParams = {
+ /**
+ * Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.
+ */
+ date_from?: string;
+ /**
+ * Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.
+ */
+ date_to?: string;
/**
* When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.
*/
diff --git a/services/mcp/src/generated/replay_vision/api.ts b/services/mcp/src/generated/replay_vision/api.ts
index 4959d8adbf56..b3f01d33b19a 100644
--- a/services/mcp/src/generated/replay_vision/api.ts
+++ b/services/mcp/src/generated/replay_vision/api.ts
@@ -44,6 +44,16 @@ export const VisionObservationsRetrieveParams = /* @__PURE__ */ zod.object({
})
export const VisionObservationsRetrieveQueryParams = /* @__PURE__ */ zod.object({
+ date_from: zod
+ .string()
+ .optional()
+ .describe('Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.'),
+ date_to: zod
+ .string()
+ .optional()
+ .describe(
+ 'Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.'
+ ),
labeled: zod
.string()
.optional()
@@ -489,6 +499,16 @@ export const VisionScannersObservationsListParams = /* @__PURE__ */ zod.object({
})
export const VisionScannersObservationsListQueryParams = /* @__PURE__ */ zod.object({
+ date_from: zod
+ .string()
+ .optional()
+ .describe('Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.'),
+ date_to: zod
+ .string()
+ .optional()
+ .describe(
+ 'Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.'
+ ),
labeled: zod
.boolean()
.optional()
@@ -542,6 +562,16 @@ export const VisionScannersObservationsRetrieveParams = /* @__PURE__ */ zod.obje
})
export const VisionScannersObservationsRetrieveQueryParams = /* @__PURE__ */ zod.object({
+ date_from: zod
+ .string()
+ .optional()
+ .describe('Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.'),
+ date_to: zod
+ .string()
+ .optional()
+ .describe(
+ 'Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.'
+ ),
labeled: zod
.string()
.optional()
@@ -592,6 +622,16 @@ export const VisionScannersObservationsStatsRetrieveParams = /* @__PURE__ */ zod
})
export const VisionScannersObservationsStatsRetrieveQueryParams = /* @__PURE__ */ zod.object({
+ date_from: zod
+ .string()
+ .optional()
+ .describe('Only observations created at or after this time. Accepts ISO 8601 or a relative date like `-7d`.'),
+ date_to: zod
+ .string()
+ .optional()
+ .describe(
+ 'Only observations created at or before this time. Accepts ISO 8601 or a relative date like `-1d`; date-only values include the whole day.'
+ ),
labeled: zod
.string()
.optional()
diff --git a/services/mcp/src/tools/generated/replay_vision.ts b/services/mcp/src/tools/generated/replay_vision.ts
index bf30a1c65266..1e139a36649a 100644
--- a/services/mcp/src/tools/generated/replay_vision.ts
+++ b/services/mcp/src/tools/generated/replay_vision.ts
@@ -119,6 +119,8 @@ const visionObservationsRetrieve = (): ToolBase<
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/observations/${encodeURIComponent(String(params.id))}/`,
query: {
+ date_from: params.date_from,
+ date_to: params.date_to,
labeled: params.labeled,
order_by: params.order_by,
recording_subject: params.recording_subject,
@@ -368,6 +370,8 @@ const visionScannersObservationsGet = (): ToolBase<
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/scanners/${encodeURIComponent(String(params.scanner_id))}/observations/${encodeURIComponent(String(params.id))}/`,
query: {
+ date_from: params.date_from,
+ date_to: params.date_to,
labeled: params.labeled,
order_by: params.order_by,
recording_subject: params.recording_subject,
@@ -398,6 +402,8 @@ const visionScannersObservationsList = (): ToolBase<
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/scanners/${encodeURIComponent(String(params.scanner_id))}/observations/`,
query: {
+ date_from: params.date_from,
+ date_to: params.date_to,
labeled: params.labeled,
limit: params.limit,
offset: params.offset,
@@ -430,6 +436,8 @@ const visionScannersObservationsStats = (): ToolBase<
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/scanners/${encodeURIComponent(String(params.scanner_id))}/observations/stats/`,
query: {
+ date_from: params.date_from,
+ date_to: params.date_to,
labeled: params.labeled,
recent_days: params.recent_days,
recording_subject: params.recording_subject,