Vision mode: add support for IP cameras / camera specification by path#190
Vision mode: add support for IP cameras / camera specification by path#190reisbauer03 wants to merge 2 commits intodnhkng:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughcamera_index was replaced by camera_spec to accept either a non-negative integer (local camera index) or a string (URI/filename, e.g., rtsp://...). Backward-compatible aliasing allows old Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
configs/glados_vision_config.yaml (1)
31-31: Quote the RTSP example for copy/paste safety.On Line 31, consider quoting the URL example to avoid YAML edge-case parsing surprises when users add credentials or query params.
Suggested tweak
- # camera_spec: rtsp://192.168.0.1:5555/ # Use IP camera + # camera_spec: "rtsp://192.168.0.1:5555/" # Use IP camera🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@configs/glados_vision_config.yaml` at line 31, The commented RTSP example for camera_spec may be parsed incorrectly in YAML when users add credentials or query params; update the camera_spec example to use a quoted string (surround the URL with either single or double quotes) so the commented example remains safe for copy/paste and avoids YAML parsing edge cases—locate the commented line containing camera_spec and replace the unquoted URL with a quoted URL string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/glados/vision/vision_config.py`:
- Line 19: The AliasChoices instantiation currently lists the deprecated key
first so Pydantic v2 will prefer "camera_index" over "camera_spec"; update the
call to AliasChoices so the new key is first (i.e., use
AliasChoices("camera_spec", "camera_index")) to ensure "camera_spec" takes
precedence when both are present.
In `@src/glados/vision/vision_processor.py`:
- Around line 135-137: The logs in VisionProcessor currently emit
repr(self.config.camera_spec), risking credential exposure for RTSP/http URLs;
change the logging to use a redacted camera spec instead by adding a small
helper (e.g., redact_camera_spec(camera_spec)) that parses the URL (using
urllib.parse.urlparse) and removes or masks username/password (or replaces them
with "<redacted>") while preserving host/path, then replace all uses of
repr(self.config.camera_spec) in VisionProcessor (where the error/ retry/ info
logs appear) with the redacted string; ensure the helper is reused for every log
site to avoid leaking credentials.
---
Nitpick comments:
In `@configs/glados_vision_config.yaml`:
- Line 31: The commented RTSP example for camera_spec may be parsed incorrectly
in YAML when users add credentials or query params; update the camera_spec
example to use a quoted string (surround the URL with either single or double
quotes) so the commented example remains safe for copy/paste and avoids YAML
parsing edge cases—locate the commented line containing camera_spec and replace
the unquoted URL with a quoted URL string.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7cc448a4-13ae-4521-a7d8-591a35309ba5
📒 Files selected for processing (3)
configs/glados_vision_config.yamlsrc/glados/vision/vision_config.pysrc/glados/vision/vision_processor.py
…RL credentials in logging (CodeRabbit suggestions)
Pull Request Summary – Flexible IP Camera Support
This PR makes the vision configuration more flexible by letting you specify a camera either by its numeric index or by a full path/URL. It doesn’t add new features—OpenCV already handles these kinds of inputs—but it updates the configuration schema to make those options available.
Configuration Change –
vision.camera_indexis replaced withvision.camera_spec. The old key is kept for backward compatibility.Supported Formats –
camera_specaccepts either a non‑negative integer (camera index) or a string (file path, network stream URL, etc.).Code Update – All internal references to
vision.camera_indexhave been switched tovision.camera_spec.Documentation – The example config file
configs/glados_vision_config.yamlhas been updated to illustrate the newcamera_specusage.No new functionality is introduced; this change simply expands how the existing camera support can be configured.
Summary by CodeRabbit
New Features
Improvements