Skip to content

fix(studio): no enviar residuos de SFX en generation.speech y generation.music - #288

Merged
IAnMove merged 1 commit into
feat/shared-tool-commandsfrom
cursor/bc-6deab105-cc79-440c-a282-47202d0b9de7-4dd9
Sep 9, 2026
Merged

fix(studio): no enviar residuos de SFX en generation.speech y generation.music#288
IAnMove merged 1 commit into
feat/shared-tool-commandsfrom
cursor/bc-6deab105-cc79-440c-a282-47202d0b9de7-4dd9

Conversation

@cursor

@cursor cursor Bot commented Sep 9, 2026

Copy link
Copy Markdown

Resumen ejecutivo

Qué cambia

El adaptador del formulario de Speech y Music descarta los campos que solo SFX escribe (MMAudio_prompt, sfx_text_weight y el resto de controles MMAudio) antes de construir el comando cerrado.

Para qué sirve

Tras rellenar SFX y pasar a Speech o Music, Generate fallaba: Speech rechazaba un MMAudio_prompt activo y Music rechazaba sfx_text_weight como campo desconocido. El usuario no veía esos controles en la pestaña nueva.

Impacto para el usuario

Puede generar Speech o Music después de usar SFX. El envelope MCP/Wizard directo sigue fallando en cerrado si envía esos campos.

Riesgo

  • Bajo
  • Medio
  • Alto

Estado

  • En desarrollo
  • Listo para revisión
  • Bloqueado por CI o revisión
  • Requiere migración o acción manual

Summary

Studio Audio tabs share one params map. SfxControls writes MMAudio_prompt, MMAudio_neg_prompt and sfx_text_weight. Tab isolation stashes audio/TTS refs (and PR #287 stashes video_guide) but leaves SFX prompt/weight in place.

generation.speech catalogues MMAudio_prompt as an inactive "" | null sentinel, so a leftover sound description fails closed. sfx_text_weight is not in the Speech or Music catalogs, so projectStudioMusicFormParams / projectStudioSpeechFormParams throw not supported.

Trigger: Audio → SFX, type a description or move Strength, switch to Speech or Music, click Generate.

This PR adds neutralizeSfxOwnedFormFields and runs it only in the Studio form adapters (prepareStudioSpeechSubmission / prepareStudioMusicSubmission) before projection. Direct MCP envelopes still 422.

Does not stash SFX drafts across tabs (documented remaining work on #280). Does not change video_guide isolation (PR #287) or Speech TTS residue on Music (PR #283).

Overview

  1. User fills Studio → Audio → SFX (description and/or strength).
  2. User switches to Speech or Music and clicks Generate.
  3. Before: admission failed on leftover MMAudio_prompt or sfx_text_weight.
  4. After: the form snapshot drops SFX-owned keys; Speech/Music commands keep the visible lyrics/script.

Detailed changes

Backend

No server contract change. Native speech/music schemas already rejected these leftovers.

UI and Wizard

  • sfxFormResidue.ts: list of SFX-owned form keys and a strip helper.
  • speechCommandSubmission.ts / musicCommandSubmission.ts: neutralize before projection.

Data, provenance and compatibility

No sidecar change. SFX drafts remain in the in-memory params map when the user returns to the SFX tab.

Files and ownership

  • ui/src/features/studio/sfxFormResidue.ts — new helper
  • ui/src/features/studio/speechCommandSubmission.ts — form-only strip
  • ui/src/features/studio/musicCommandSubmission.ts — form-only strip
  • ui/tests/studioSpeechGenerationCommands.test.ts — closed builder still rejects; form path admits
  • ui/tests/musicGenerationCommands.test.ts — same for Music
  • ui/tests/studioSpeechCommandPresentation.test.tsx / studioMusicCommandPresentation.test.tsx — prepare path

Left untouched: audioReferenceState.ts (PR #287), Speech TTS neutralize on Music (PR #283), duration overwrite in loadModelOptions.

Validation

  • Date (UTC): 2026-09-09

  • Base SHA: 07be48c196d4ff0f04881e3401fff69735c830f8 (feat/shared-tool-commands)

  • Head SHA: c5f235d7

  • Validation scope: focused

  • python scripts/verify_clean_repo.py — N/A (UI-only)

  • python -m compileall -q app/services app/launch.py scripts — N/A

  • Focused Python tests: N/A

  • cd ui && npm run i18n:check — not required (no i18n keys)

  • UI tests: npx tsx --tsconfig tsconfig.app.json --import ./tests/setupI18n.ts --test tests/studioSpeechGenerationCommands.test.ts tests/musicGenerationCommands.test.ts tests/studioSpeechCommandPresentation.test.tsx tests/studioMusicCommandPresentation.test.tsx31/31 pass

  • cd ui && npm run lint -- --max-warnings=0 — not run (focused change)

  • cd ui && npm run build — not run

  • git diff --check — clean

  • E2E/smoke checks: N/A — command-contract unit tests cover the trigger; no live generation

Code quality

  • Score: pending CI
  • Complexity trend: pending CI
  • Production LOC trend: pending CI
  • Regression versus main: pending CI
  • Ratchet: pending CI

CI and review

  • CI of this HEAD: pending

  • Independent agent review of this HEAD: pending

  • Human merge click (operational, not code review): pending

  • Reviewed at current HEAD

  • Earlier review; HEAD has changed since (stale)

  • Pending

  • Unavailable

Coste de la tarea

  • Tests simulados: 0 tokens externos
  • Tests reales: N/A
  • Llamadas LLM externas: 0
  • Tokens de prompt: N/A
  • Tokens de respuesta: N/A
  • Tokens totales: N/A
  • Generaciones de imágenes/audio/vídeo: 0
  • Tiempo transcurrido: N/A
  • Proveedores/modelos: N/A

Notes and limitations

SFX prompt/weight/duration are still not stashed across tabs. Direct envelopes still reject explicit SFX fields on generation.speech / generation.music. video_guide leftover remains PR #287.

Follow-up work

Checklist

  • The executive summary is understandable without reading the code.
  • The detailed Summary/Overview has not been removed or shortened.
  • Tests and their actual results are recorded.
  • Generated assets, secrets and local-only files are not committed.
  • Required CI and Cursor/Bugbot review are complete, or the PR is clearly marked as waiting for them.
Open in Web View Automation 

SFX escribe MMAudio_prompt y sfx_text_weight en el formulario compartido.
Al pasar a Speech o Music, generation.speech rechazaba el prompt activo y
generation.music rechazaba el peso desconocido. El adaptador del formulario
los descarta; el envelope cerrado de MCP sigue fallando en cerrado.

Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
@IAnMove
IAnMove merged commit f146357 into feat/shared-tool-commands Sep 9, 2026
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.

2 participants