fix(story): no rechazar el MP3 custom transcodificado ni fallar el cover del catálogo - #248
Merged
IAnMove merged 1 commit intoSep 7, 2026
Conversation
…covers Device custom-MP3 picks go through /upload-audio, which transcodes mp3 to wav. Require-mp3 after that upload rejected every from-disk import. Cover generation also looked only in uploads/audio/, so a catalog workspace track bound as a cover failed at generate time. Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
IAnMove
changed the base branch from
grok/agente2-story-audio-06ffec07
to
development
September 7, 2026 20:53
IAnMove
marked this pull request as ready for review
September 7, 2026 20:54
Author
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_e25bafd4-a0e9-4797-ac35-9beba4a7f77e) |
PR Review — Loreframe StudioRisk: low Automated review from Findings
Changed files
CONTRIBUTING checklist
Posted by the repo PR review workflow. Re-runs on each push to the PR. |
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumen ejecutivo
Qué cambia
El import de MP3 custom desde el disco acepta el WAV que deja
/upload-audio. La generación de cover también resuelve un tema del workspace/catálogo, no solouploads/audio/.Para qué sirve
En #245, Import custom MP3 desde el dispositivo sube el archivo, el servidor transcodifica mp3→wav y
commitStoryAudioChoice(..., requireMp3)rechazaba ese artefacto. El cover del picker compartido guardaba solo el basename; si el tema vivía en el workspace, MiniMax respondía 400.Impacto para el usuario
Volver a poder importar un MP3 desde el disco como candidato de cue. Poder generar un cover usando un audio ya generado en la biblioteca.
Riesgo
Estado
Summary
isCustomMp3Outputnow treats/api/v1/uploads/audio/(anduploads/audio/paths) as a valid custom-MP3 choice, because/upload-audiotranscodes mp3/m4a/aac to wav beforeonChoose. Catalog non-mp3 rows stay rejected. Cover jobs resolveuploads/audio/{basename}first, then the workspace-confined media path, so a catalog track bound ascoverReferenceFilenameis found.Overview
PR #245 routes cover / Lyria / custom MP3 through
StoryAudioPicker. Device files upload viaAssetInput→uploadAudio. That endpoint always transcodes mp3 to{uuid}.wavand deletes the original. The newrequireMp3guard then saw.wavand returnedreject, so every from-device custom import failed after a successful upload.Cover generation still joined
uploads/audio/+ basename only. A library song stored in the workspace (typical MiniMax output) produced a success notice in the UI and thenUpload a valid reference song before generating a cover.Detailed changes
Backend
resolve_story_cover_audioinmedia_paths.py. Both MiniMax music candidate endpoints use_story_cover_reference_pathinstead of_safe_join(uploads/audio, basename)only.UI and Wizard
isUploadedAudioOutput+isCustomMp3Outputaccept the post-transcode upload artifact. Catalog wav/flac via/api/v1/file/still reject.Data, provenance and compatibility
No sidecar change. Custom candidates keep
model: custom-audio-upload. Cover still stores basename; the server now finds that name in uploads/audio or the workspace.Files and ownership
ui/src/features/stories/storyAudioPick.ts— accept transcoded uploads as custom MP3ui/tests/storyAudioPick.test.mjs— device wav upload still applies; catalog wav still rejectedapp/services/media_paths.py— cover resolverapp/_launch_runtime.py— both music-candidate endpointstests/test_media_path_security.py— upload-then-workspace cover resolution + AST checkValidation
Date (UTC): 2026-09-07
Base SHA: 12b07db (
grok/agente2-story-audio-06ffec07)Head SHA: 2a50c15
Validation scope: focused
python scripts/verify_clean_repo.pypython -m compileall -q app/services/media_paths.pyFocused Python tests:
python3 -m pytest tests/test_media_path_security.py tests/test_story_lab_audio_ui.py -q— 11 + 17 passedcd ui && npm run i18n:checkUI tests:
npx tsx --tsconfig tsconfig.app.json --test tests/storyAudioPick.test.mjs— 5/5 passcd ui && npm run lint -- --max-warnings=0cd ui && npm run buildgit diff --checkE2E/smoke checks: N/A (picker commit + path resolver; no GPU)
Code quality
main: pending CICI and review
Coste de la tarea
Notes and limitations
Fix PR for #245. Merge this into
grok/agente2-story-audio-06ffec07before landing the picker work. Catalog non-mp3 rows remain rejected. Cover still prefersuploads/audio/when the same basename exists there and in the workspace.Follow-up work
None.
Checklist
Note
Low Risk
Narrow UI guard and confined media-path resolution reuse existing security patterns; no auth or data-model changes.
Overview
Fixes two Story audio picker regressions: custom MP3 from disk and cover generation from catalog/workspace tracks.
On the UI,
isCustomMp3Outputnow treats artifacts underuploads/audio(including the WAV returned after/upload-audiotranscodes mp3/m4a/aac) as valid custom imports whenrequireMp3is set, while catalog rows served via/api/v1/file/still must look like MP3.On the backend, cover jobs no longer join only
uploads/audio/{basename}. Newresolve_story_cover_audioprefers a confined file inuploads/audio, then falls back toresolve_permitted_media_pathin the active workspace. Bothstart_story_music_candidates_jobandgenerate_story_music_candidatesuse_story_cover_reference_pathfor that logic. Tests cover upload-vs-workspace precedence and AST checks that both endpoints call the shared helper.Reviewed by Cursor Bugbot for commit 2a50c15. Configure here.