Skip to content

feat(replays): Add replay timeline inspector - #1178

Draft
sentry-junior[bot] wants to merge 2 commits into
mainfrom
feat/replay-timeline-inspector
Draft

feat(replays): Add replay timeline inspector#1178
sentry-junior[bot] wants to merge 2 commits into
mainfrom
feat/replay-timeline-inspector

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Add a catalog-only inspect_replay_timeline tool that reconstructs timestamped replay activity so agents and clients can explain what happened around an error or frustrating interaction.

Structured Timeline Contract

The tool declares an output schema and returns structured-only results with replay identity, availability status, applied filters, pagination counts, and typed timeline events. Each event carries absolute and replay-relative timestamps plus typed key/value details; compatibility text is generated by the MCP server.

Focused Inspection

Callers can filter by event category, focus on an absolute timestamp window, and cap the returned timeline. Archived and segmentless replays use the same stable output shape with an explicit status and unavailable reason.

Project constraints remain enforced, replay recording failures remain visible, and the tool stays catalog-only behind the existing replay capability.

sentry-junior Bot and others added 2 commits July 23, 2026 19:32
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: David Cramer <david@sentry.io>
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: David Cramer <david@sentry.io>
Comment on lines +209 to +211
const aroundMs = params.aroundTimestamp
? Date.parse(params.aroundTimestamp)
: null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aroundTimestamp Date.parse NaN silently filters all timeline events

Date.parse is not guarded for NaN, so valid-ISO but unparsable timestamps silently filter out all events.

Evidence
  • aroundTimestamp passes z.string().datetime({ offset: true }) validation, but Date.parse can still return NaN for valid-format but out-of-range dates (e.g., "0000-01-01T00:00:00Z").
  • aroundMs is assigned Date.parse(params.aroundTimestamp) without a Number.isNaN check (line 209).
  • The window filter Math.abs(event.timestampMs - aroundMs) <= windowMs evaluates to NaN <= windowMs, which is always false (line 221).
  • Every event is excluded and the caller receives an empty events array with no error or warning.
  • parseTimestamp(replay.started_at) in the same file correctly guards against NaN at line 425–426, showing the expected pattern was omitted for aroundTimestamp.

Identified by Warden · code-review · E2J-4UD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants