docs: document mp4_url on the session replay endpoint - #889
Conversation
Call out the presigned MP4 URL in feature guides, ReplayResponse, and a dedicated API page so clients do not have to discover it from live responses. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reached
Next review available in: 26 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| docs/src/api-reference/using-session-replay.mdx | Adds the REST replay guide, but incorrectly presents nullable expires_at as a required string. |
| docs/src/features/sessions/recordings.mdx | Expands recording documentation with replay fields, a REST example, and links to the new API guide. |
| docs/src/sdk-reference/misc/replayresponse.mdx | Clarifies replay use cases and accurately documents the nullable SDK response fields. |
| docs/src/docs.json | Registers the new Session Replay page under API Getting Started. |
| docs/src/testers/agents/replay/basic_replay.py | Keeps the generated replay snippet source synchronized, but does not execute or validate the documented response contract. |
Prompt To Fix All With AI
### Issue 1
docs/src/api-reference/using-session-replay.mdx:40-42
**Preserve `expires_at` nullability**
When a replay response omits `expires_at` or returns null, this non-nullable field declaration tells clients they can safely perform string or date operations, causing runtime failures against a valid `ReplayResponse`.
```suggestion
<ResponseField name="expires_at" type="string | null">
When the presigned URLs expire. Download promptly if you need a durable copy.
</ResponseField>
```
### Issue 2
docs/src/api-reference/using-session-replay.mdx:37-39
**Replay contract lacks automated coverage**
The new hand-maintained response contract has no executing unit or integration test, so field mismatches such as the incorrect `expires_at` nullability can reach the published documentation without automated detection.
- Add a comment if the PR does n... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "docs: document mp4_url on the session re..." | Re-trigger Greptile
| <ResponseField name="expires_at" type="string"> | ||
| When the presigned URLs expire. Download promptly if you need a durable copy. | ||
| </ResponseField> |
There was a problem hiding this comment.
Preserve
expires_at nullability
When a replay response omits expires_at or returns null, this non-nullable field declaration tells clients they can safely perform string or date operations, causing runtime failures against a valid ReplayResponse.
| <ResponseField name="expires_at" type="string"> | |
| When the presigned URLs expire. Download promptly if you need a durable copy. | |
| </ResponseField> | |
| <ResponseField name="expires_at" type="string | null"> | |
| When the presigned URLs expire. Download promptly if you need a durable copy. | |
| </ResponseField> |
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/src/api-reference/using-session-replay.mdx
Line: 40-42
Comment:
**Preserve `expires_at` nullability**
When a replay response omits `expires_at` or returns null, this non-nullable field declaration tells clients they can safely perform string or date operations, causing runtime failures against a valid `ReplayResponse`.
```suggestion
<ResponseField name="expires_at" type="string | null">
When the presigned URLs expire. Download promptly if you need a durable copy.
</ResponseField>
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The SDK docs hook regenerates this page from types; keep hand-written mp4_url guidance on the feature and API pages instead. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/src/api-reference/using-session-replay.mdx`:
- Line 9: Update the documentation for GET /sessions/{session_id}/replay to
state that closed sessions may temporarily return 404 while replay generation is
in progress, and instruct direct REST clients to retry 404 responses until the
presigned URLs are available.
- Line 11: The documentation must clearly treat ReplayResponse.mp4_url as
nullable: in docs/src/api-reference/using-session-replay.mdx lines 11 and 52-55,
describe playlist_content as the HLS fallback and require checking mp4_url
before replay.download(); in docs/src/features/sessions/recordings.mdx lines 18,
42-52, and 131-137, remove guaranteed-MP4 wording, mark both representations
nullable, and present HLS as an available alternative; in
docs/src/sdk-reference/misc/replayresponse.mdx lines 9-11, require checking
mp4_url before download(path); and in docs/src/features/agents/replay.mdx lines
35-37, state that MP4 downloading is available only when mp4_url is present.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0f1edf11-379c-49e4-ba11-5a71bf2bf9d3
📒 Files selected for processing (8)
docs/src/api-reference/using-session-replay.mdxdocs/src/docs.jsondocs/src/features/agents/replay.mdxdocs/src/features/sessions/recordings.mdxdocs/src/llms.txtdocs/src/sdk-reference/misc/replayresponse.mdxdocs/src/snippets/agents/replay/basic_replay.mdxdocs/src/testers/agents/replay/basic_replay.py
|
|
||
| <AgentMdNotice /> | ||
|
|
||
| `GET /sessions/{session_id}/replay` returns presigned URLs for the session recording after the session has ended. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Document replay generation delay.
A closed session can still return 404 while replay generation runs. The SDK handles this by polling. Tell direct REST clients to retry 404 responses until the replay is ready.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/src/api-reference/using-session-replay.mdx` at line 9, Update the
documentation for GET /sessions/{session_id}/replay to state that closed
sessions may temporarily return 404 while replay generation is in progress, and
instruct direct REST clients to retry 404 responses until the presigned URLs are
available.
|
|
||
| `GET /sessions/{session_id}/replay` returns presigned URLs for the session recording after the session has ended. | ||
|
|
||
| The field most clients need is **`mp4_url`**: a time-limited presigned URL for the MP4 file. Use it to download or share the recording from any HTTP client (webhooks, CI, non-Python SDKs). Check `expires_at` for when the URL stops working. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Do not treat mp4_url as guaranteed.
ReplayResponse.mp4_url is nullable. tests/integration/sdk/test_sessions.py lines 51-55 accept an HLS-only response. ReplayResponse.download() raises ValueError when mp4_url is absent. State this condition and direct users to check mp4_url before downloading.
docs/src/api-reference/using-session-replay.mdx#L11-L11: Describemp4_urlas optional and nameplaylist_contentas the streaming fallback.docs/src/api-reference/using-session-replay.mdx#L52-L55: Require anmp4_urlcheck beforereplay.download().docs/src/features/sessions/recordings.mdx#L18-L18: Do not state that every replay response includes an MP4 URL.docs/src/features/sessions/recordings.mdx#L42-L52: Mark both replay representations as nullable.docs/src/features/sessions/recordings.mdx#L131-L137: Do not describe HLS as optional relative to a guaranteed MP4 URL.docs/src/sdk-reference/misc/replayresponse.mdx#L9-L11: Require anmp4_urlcheck beforedownload(path).docs/src/features/agents/replay.mdx#L35-L37: State that MP4 download is available only whenmp4_urlis present.
📍 Affects 4 files
docs/src/api-reference/using-session-replay.mdx#L11-L11(this comment)docs/src/api-reference/using-session-replay.mdx#L52-L55docs/src/features/sessions/recordings.mdx#L18-L18docs/src/features/sessions/recordings.mdx#L42-L52docs/src/features/sessions/recordings.mdx#L131-L137docs/src/sdk-reference/misc/replayresponse.mdx#L9-L11docs/src/features/agents/replay.mdx#L35-L37
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/src/api-reference/using-session-replay.mdx` at line 11, The
documentation must clearly treat ReplayResponse.mp4_url as nullable: in
docs/src/api-reference/using-session-replay.mdx lines 11 and 52-55, describe
playlist_content as the HLS fallback and require checking mp4_url before
replay.download(); in docs/src/features/sessions/recordings.mdx lines 18, 42-52,
and 131-137, remove guaranteed-MP4 wording, mark both representations nullable,
and present HLS as an available alternative; in
docs/src/sdk-reference/misc/replayresponse.mdx lines 9-11, require checking
mp4_url before download(path); and in docs/src/features/agents/replay.mdx lines
35-37, state that MP4 downloading is available only when mp4_url is present.
Match ReplayResponse typing so clients do not assume a always-present string. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
mp4_url(and the rest of the replay response) on the session recordings guide, including a REST curl exampleGET /sessions/{session_id}/replaythat highlightsmp4_urlReplayResponse/ agent replay docs and examples so the field is discoverable without inspecting a live responseTest plan
mp4_urlsection rendersMade with Cursor
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit