Conversation
- Fix retrived_track_tasks_results -> revivedTrackTaskResults (camelCase) in enhance_controller.py, which silently broke the primary extraction path - Add 6 typed response dataclasses: EnhancedTrackResult, PreviewMixResult, FinalMixResult, PreviewMasterResult, FinalMasterResult, AnalysisResult - Update all 7 retrieval methods to return typed models instead of raw dicts - Rewrite inaccurate docstrings to reflect actual server response shapes - Update unit tests for new return types and corrected key names - Bump version to 1.3.2 Made-with: Cursor
All example scripts still used .get() / [] on return values that are now dataclass instances (EnhancedTrackResult, PreviewMasterResult, etc). Updated to use attribute access (.download_url_revived, .payload, etc). Made-with: Cursor
- advanced_mix_example.py: use .download_url_preview_mixed / .download_url_mixed - test_mastering_integration.py: use .download_url_mastered_preview attribute - test_analysis_integration.py: use .payload attribute instead of dict .get() - smoke_test.py: bump version assertion to 1.3.2, use .payload on AnalysisResult Made-with: Cursor
The API returns revivedTrackTaskResults with null download URLs in 202 (still processing) responses. The polling loop treated any truthy dict as completion, causing retrieve_enhanced_track to return an EnhancedTrackResult with all None fields. Now checks that at least one download URL is populated before considering the task complete. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit aee61d0. Configure here.
| else: | ||
| # If the response doesn't indicate it's processing, return it as is | ||
| return response | ||
| return _parse_preview_result(response) |
There was a problem hiding this comment.
Early return silently drops nested preview mix results
Low Severity
When the API returns previewMixTaskResults with completed data but without a top-level status key, the first condition (line 157) fails because response.get("status") is None. The second condition (line 161) also fails because "status" not in response. The else branch then calls _parse_preview_result(response) on the outer response dict, which only looks for download_url_preview_mixed etc. at the top level — missing the data nested inside previewMixTaskResults. This returns an empty PreviewMixResult and skips polling entirely. The old code returned the raw response dict, which at least preserved the nested data for callers to inspect.
Reviewed by Cursor Bugbot for commit aee61d0. Configure here.


Summary
retrieve_enhanced_trackwas usingrevived_track_tasks_results(snake_case) to read the server response, but the server returnsrevivedTrackTaskResults(camelCase). This silently broke the primary extraction path, causing the method to always fall through to a slower fallback or fail entirely.retrieve_enhanced_trackpolling exited early on 202 responses becauserevivedTrackTaskResultswas present (with null URLs). Now checks that at least one download URL is populated before treating the task as complete.retrieve_enhanced_track,retrieve_preview_mix,retrieve_final_mix,retrieve_final_mix_advanced,retrieve_preview_master,retrieve_final_master,analyze_mix) now return typed dataclasses instead of rawdict. New models:EnhancedTrackResult,PreviewMixResult,FinalMixResult,PreviewMasterResult,FinalMasterResult,AnalysisResult.preview_start_timefield)..get()access to typed attribute access.Test plan
pytest tests/unit/ -q)upload_example.py— file uploadedanalysis_example.py— full analysis with metrics returnedenhance_example.py— preview + full enhancement + 4 stems downloadedmastering_example.py— preview + final master downloadedaudio_cleanup_example.py— cleaned audio downloadedmix_example.py/advanced_mix_example.pyimports verified (require multiple audio files)dataclasses.asdict()Note
Medium Risk
Public return types change from
dictto dataclasses across multiple controllers, which can break downstream callers and subtly alter fallback parsing behavior.Overview
Adds typed response models and normalizes retrieval parsing across the SDK. The mix, mastering, enhance, and analysis retrieval methods now return dedicated dataclasses (
PreviewMixResult,FinalMixResult,PreviewMasterResult,FinalMasterResult,EnhancedTrackResult,AnalysisResult) instead of rawdicts, and examples/tests were updated to use attribute access (plusasdict()for JSON serialization).Fixes an enhance retrieval bug and cleans up API response handling/docs.
retrieve_enhanced_tracknow reads the correct server key (revivedTrackTaskResults), polling/parsing logic in several controllers was simplified to extract the expected nested result objects, and docstrings were rewritten to match actual response shapes (includingpreview_start_time). Version bumped to1.3.2with changelog updates.Reviewed by Cursor Bugbot for commit aee61d0. Bugbot is set up for automated code reviews on this repo. Configure here.