#1698·OpenMAIC

Classroom TTS pre-generation ignores the TTS_<PREFIX>_MODELS server-side model pin

Author: afanty2021Created Sep 27, 2026Updated Sep 27, 2026

Steps to reproduce

  1. Configure a server-managed TTS provider whose gateway only serves one specific model, e.g. a local OpenAI-compatible endpoint behind TTS_OPENAI_BASE_URL, and pin that model with TTS_OPENAI_MODELS=pinned-tts-a (the pin mechanism from lib/server/provider-config.ts).
  2. Generate a classroom that contains narratable speech actions (server-side TTS pre-generation path, generateTTSForClassroom in lib/server/classroom-media-generation.ts).
  3. Observe the TTS loop.

Expected behavior

The pre-generation loop honors the operator's {PREFIX}_MODELS pin and requests pinned-tts-a, exactly like POST /api/generate/tts (resolveTTSModel in the route) and the agent-runtime path (lib/server/agent-runtime/scene-tts.ts) already do.

Actual behavior

generateTTSForClassroom passes DEFAULT_TTS_MODELS[providerId] straight to generateTTS, bypassing resolveTTSModel. The catalog default (gpt-4o-mini-tts for openai-tts) is sent verbatim; a gateway that only serves the pinned model answers model not found, and every narration line fails (each is retried, then skipped as silent after the back-off budget).

Example from a local Qwen3-TTS gateway on the TTS_OPENAI slot:

json
{"error":{"message":"Model 'gpt-4o-mini-tts' not found. Available: Qwen3-TTS-12Hz-1.7B-CustomVoice-8bit, ..."}}

The same request through the TTS route succeeds, because that path resolves the pin — only the classroom pre-generation path bypasses it.

Environment

  • Version: v1.1.0 (21d83ec5)
  • Node: 26.8.1, macOS (arm64)
  • Any deployment that sets TTS_<PREFIX>_MODELS for the TTS provider used by server-side classroom narration; most visible against gateways serving a single pinned model.

Suggested fix

Route the classroom path through resolveTTSModel like the other two callers (one-line change at the modelId construction site). I have a patch with regression tests ready to open as a PR.