Skip to content

fix: preserve directories in speech subtitle paths - #285

Open
ch-z-hc wants to merge 1 commit into
MiniMax-AI:mainfrom
ch-z-hc:fix/speech-subtitle-path
Open

ch-z-hc wants to merge 1 commit into
MiniMax-AI:mainfrom
ch-z-hc:fix/speech-subtitle-path

Conversation

@ch-z-hc

@ch-z-hc ch-z-hc commented Oct 13, 2026 •

Copy link
Copy Markdown

Bug

With --subtitles --out session.v1/clip, synthesis saves the audio at the requested path but writes the subtitle to session.srt in the parent directory. The extension-removal regex matches across path separators when the audio filename has no extension. A hidden filename such as .clip also loses its name.

Fix

Use Node's path.extname() to remove only the filename's extension, leaving the directory and the rest of the path unchanged. No changes to fetching, audio output, or subtitle conversion.

Four regressions execute the actual synthesis command against a local HTTP fixture and check audio/subtitle contents, printed paths, and that no file appeared in the parent directory. They cover ordinary, multi-dot, extensionless, and hidden filenames under a dotted directory. On the original code, the two extensionless cases fail and the two compatibility cases pass; all four pass with the fix.

Validation

  • Bun 1.4.0: synthesis command tests 29 passed on Windows and Linux.
  • Typecheck passes on both platforms; lint has no errors and one existing speech.test.ts warning.
  • Linux production build, compiled CLI, and mmx --version pass.
  • Two independent automated blind reviews: no actionable findings. One reviewer also independently reproduced both original failures and verified five filename cases with the patch.
  • Full Linux run: 600 passed, 3 failed. Unchanged a965e72 under the same runtime has 596 passed, the same 3 failed: unreachable-region timeouts in timeout-fix.test.ts and auth/login.test.ts, plus the FileSDK upload base-URL assertion. These failures are not fixed or diagnosed here. Both runs use the same validation-only fetch preload rejecting non-loopback destinations; no repository tests or timeouts were relaxed.

No live MiniMax service calls. Implemented and tested with Codex assistance; the independent blind reviews were automated, not human review.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@ch-z-hc
ch-z-hc marked this pull request as ready for review October 14, 2026 08:22
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.

1 participant