Skip to content

Conversation

@omgate234
Copy link
Contributor

@omgate234 omgate234 commented Oct 13, 2025

Previous Behaviour

  • If Director is asked info about a video, it returns an HLS stream of the video, which cannot be directly played and requires for the console.videodb.io/player?url=<stream_url> to be manually be visited

Proposed Behaviour

  • Based on the updated system prompt, Director is going to display the player link which allows them to view the video

Summary by CodeRabbit

  • New Features
    • When HLS (m3u8) links are shown, a matching web player link is now included: https://console.videodb.io/player?url={hls_url}.
    • Enables instant in-browser playback of HLS streams for quicker previews and testing.
    • Applies wherever HLS URLs appear in responses, reducing the need for external players and simplifying workflows.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

Walkthrough

Added a new policy rule to the REASONING_SYSTEM_PROMPT in backend/director/core/reasoning.py requiring HLS (m3u8) links to be accompanied by a corresponding player link formatted as https://console.videodb.io/player?url={hls_url}. No code structure or control flow changes.

Changes

Cohort / File(s) Summary
Reasoning prompt update
backend/director/core/reasoning.py
Extended REASONING_SYSTEM_PROMPT with rule 9 to include a player link when displaying HLS (m3u8) URLs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my ears at rule number nine,
For HLS streams, I add a player line.
A nibble of URLs, neat and bright,
console.videodb.io takes flight.
Hop, hop—links in tandem show,
m3u8 and player in a row.
Carrots and compliance—let’s go! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and succinctly describes the primary change—updating the system prompt to include a player link—using concise phrasing without unnecessary detail or noise. It accurately reflects the main purpose of the changeset so a teammate can understand the intent at a glance.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e323157 and f4af36e.

📒 Files selected for processing (1)
  • backend/director/core/reasoning.py (1 hunks)
🔇 Additional comments (1)
backend/director/core/reasoning.py (1)

65-67: Add test coverage or manual validation for HLS Stream Display instruction
No existing tests reference .m3u8 or player_url—add unit/integration tests (or manually verify) to ensure the LLM consistently outputs https://console.videodb.io/player?url={hls_url} alongside HLS URLs across different query patterns.

Comment on lines +65 to +67
9. **HLS Stream Display**:
- When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={hls_url}
- This ensures users can easily access the video player for HLS streams.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Clarify URL encoding requirement in the instruction.

The instruction should explicitly state that {hls_url} must be URL-encoded when inserted into the query parameter to handle HLS URLs containing special characters (e.g., ?, &, =). Without proper encoding, player links may break.

Apply this diff to make the encoding requirement explicit:

 9. **HLS Stream Display**:
-   - When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={hls_url}
+   - When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={url_encoded_hls_url}
+   - Ensure the HLS URL is properly URL-encoded before inserting it into the query parameter.
    - This ensures users can easily access the video player for HLS streams.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
9. **HLS Stream Display**:
- When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={hls_url}
- This ensures users can easily access the video player for HLS streams.
9. **HLS Stream Display**:
- When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={url_encoded_hls_url}
- Ensure the HLS URL is properly URL-encoded before inserting it into the query parameter.
- This ensures users can easily access the video player for HLS streams.
🤖 Prompt for AI Agents
In backend/director/core/reasoning.py around lines 65 to 67, the HLS player-link
guidance omits that the {hls_url} must be URL-encoded; update the instruction to
explicitly require URL-encoding (e.g., using percent-encoding) when inserting
the HLS URL into the query parameter so characters like ?, &, = are escaped
(resulting in links like
https://console.videodb.io/player?url={url_encoded_hls_url}); make the text
clear and concise, mention percent-encoding or use of standard URL-encoding
functions, and keep the example format showing the encoded placeholder.

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.

1 participant