Skip to content

[codex] Fix MiniMax TTS fallback and HTML extraction#528

Draft
dragon-hh wants to merge 1 commit intoTHU-MAIC:mainfrom
dragon-hh:codex/fix-minimax-tts-and-html-extraction
Draft

[codex] Fix MiniMax TTS fallback and HTML extraction#528
dragon-hh wants to merge 1 commit intoTHU-MAIC:mainfrom
dragon-hh:codex/fix-minimax-tts-and-html-extraction

Conversation

@dragon-hh
Copy link
Copy Markdown

Summary

This PR fixes two provider-integration issues found while running OpenMAIC with a server-configured MiniMax setup:

  • allow server-configured TTS credentials to be reused when clients echo the provider's server base URL back to /api/generate/tts
  • make interactive HTML extraction tolerant of truncated or unterminated fenced HTML responses from non-default LLM providers

Root cause

The TTS API previously treated any request-level ttsBaseUrl as a fully client-supplied provider configuration. When the UI sent the server-synced MiniMax serverBaseUrl, the route skipped the server API key fallback and failed with API key required for TTS provider: minimax-tts.

Interactive widget generation also required a complete </html> document or a closed Markdown code fence. Some model responses start with valid HTML inside a ```html block but may omit the final </html> or closing fence, causing scene-content generation to fail even though usable HTML was present.

Changes

  • Normalize and compare requested TTS base URLs against the server-configured provider URL before deciding whether to require client credentials.
  • Avoid passing server-only TTS base URLs from the settings preview path as client custom URLs.
  • Export and harden extractHtml so valid started HTML can be extracted even when the model response is truncated.
  • Add regression coverage for unterminated HTML code blocks.

Validation

pnpm test tests/generation/scene-generator-language-directive.test.ts tests/audio/minimax-tts-models.test.ts tests/server/provider-config.test.ts tests/store/settings-server-sync.test.ts

Result: 4 test files passed, 82 tests passed.

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