posthog-fix-replay-buffering

Based on#53893
SegmentInvestigate-and-fix
Typebug
## Task

Customers are reporting that session replays sometimes hang on the "Buffering..." spinner forever. The repro is loading a recording URL whose `?t=<seconds>` parameter is past the end of the recording (usually a shared/exported URL where the timestamp got out of bounds). We fixed some of this before but the stuck-buffer state still reproduces on the same URL shape. Also seems to be a related case where clicking "back to start" on a recording that has already loaded leaves it stuck buffering at the very start. Investigate and resolve.

## General instructions

- The code repo is at /repo/posthog.
- You are inside of a Docker container. You may not be able to perform all operations you would normally be able to do on a local machine. Dependencies have not been pre-installed, and you may need to install them yourself.
- You are expected to act autonomously as a software engineer to complete tasks you are given.
- Do not stop until you feel you have completed the task and your code changes can be merged.
- You may need to use software engineering skills like analyzing the codebase, researching technologies, running services, analyzing logs, etc. to complete the task. Not all tasks will be solvable by reading source code alone.

Agent Results

AgentTastefulBasicVerifierValidationRubricBloatPractTasteCheated
Oracle
3/31.001.0x5.04.0
GLM-5.2
2/31.000.4x3.02.0
GPT-5.4
2/31.000.8x3.02.0
GPT-5.5
2/31.002.0x3.02.0
Opus 4.8
2/31.000.4x4.02.0
Gemini 3.1 Pro
1/30.000.0x4.02.0
Gemini 3.5 Flash
1/30.000.0x2.02.0
Kimi K2.6
1/30.000.1x4.03.0
Opus 4.7
1/31.000.2x3.03.0
Sonnet 4.6
1/30.000.3x3.02.0
Sonnet 5
No-Op
1/30.00
Agent details

Verifier Tests

Gemini 3.1 Pro1/3

Rubric Criteria

Gemini 3.1 Pro0/1
Fail → Pass
documents_reactivity_boundary

Taste Scores

Patch Bloat0.0x
3 agent / 62 oracle SLOC, 1 / 5 files
Practice Alignment — 4.0/5
4
style consistency
3
pattern adherence
4
library usage
3
abstraction level
4
documentation fit
Relative Taste — 2.0/5
3
minimality
1
approach quality
2
hygiene
2
fluency
1
craftsmanship

Agent Patch