Conversation
WalkthroughFrontend API refactored to track multiple per-file conversations via a Map instead of single conversation ID. Backend audio utilities switched from pipe-based to disk-backed temporary files and added duration probing directly from merge results. Conversation API updated to retrieve durations from merge operations or Directus instead of separate S3 calls. Tests updated to handle new tuple return type. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
echo/server/dembrane/audio_utils.py (1)
340-341:⚠️ Potential issue | 🟡 Minor
total_size_mbis dead code - always logs 0.The variable is initialized but never updated. The log at line 449 will always report
Total input size: 0.0MB. Ship it or fix it, but definitely don't leave stale telemetry.🛠️ Proposed fix
Either track the size properly:
total_size_mb = 0 + for i_name in input_file_names: + try: + response = s3_client.head_object( + Bucket=STORAGE_S3_BUCKET, Key=get_sanitized_s3_key(i_name) + ) + total_size_mb += response["ContentLength"] / (1024 * 1024) + except Exception: + passOr remove the misleading log:
logger.info( - f"Completed merging {len(input_file_names)} files in {elapsed:.2f}s. " - f"Total input size: {total_size_mb:.1f}MB, duration: {audio_duration:.1f}s" + f"Completed merging {len(input_file_names)} files in {elapsed:.2f}s. " + f"Duration: {audio_duration:.1f}s" )Also applies to: 448-449
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@echo/server/dembrane/audio_utils.py` around lines 340 - 341, The variable total_size_mb is initialized but never updated, so the "Total input size" log always prints 0.0MB; either remove that misleading log or update total_size_mb as you process inputs (e.g., inside the loop that builds/reads chunks or files, add bytes/ (1024*1024) to total_size_mb or sum os.path.getsize(file) for each input) and then log the computed value. Update references to total_size_mb (and the log call that prints it) so the metric reflects the actual accumulated input size.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@echo/server/dembrane/audio_utils.py`:
- Around line 340-341: The variable total_size_mb is initialized but never
updated, so the "Total input size" log always prints 0.0MB; either remove that
misleading log or update total_size_mb as you process inputs (e.g., inside the
loop that builds/reads chunks or files, add bytes/ (1024*1024) to total_size_mb
or sum os.path.getsize(file) for each input) and then log the computed value.
Update references to total_size_mb (and the log call that prints it) so the
metric reflects the actual accumulated input size.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: f2892854-7104-4f8c-87a7-8f7dac6fdb34
📒 Files selected for processing (4)
echo/frontend/src/lib/api.tsecho/server/dembrane/api/conversation.pyecho/server/dembrane/audio_utils.pyecho/server/tests/test_audio_utils.py
Summary by CodeRabbit
Bug Fixes
Refactor