chenhg5/cc-connect · error

tts provider is not configured

Error message

tts provider is not configured

What it means

Engine.synthesizeAndSendTTS distinguishes between TTS being enabled and an actual provider backend being attached. If e.tts.Enabled is true but e.tts.TTS (the provider implementation) is nil, synthesis cannot run and this error is thrown.

Source

Thrown at core/engine.go:15872

	}
	return chunks
}

// sendTTSReply synthesizes fullResponse text and sends audio to the platform.
// Called asynchronously after EventResult; text reply is always sent first.
func (e *Engine) sendTTSReply(p Platform, replyCtx any, text string) {
	slog.Debug("tts: sendTTSReply called", "platform", p.Name(), "text_len", len(text))
	if err := e.synthesizeAndSendTTS(p, replyCtx, text); err != nil {
		slog.Error("tts: voice reply failed", "platform", p.Name(), "error", err)
	}
}

func (e *Engine) synthesizeAndSendTTS(p Platform, replyCtx any, text string) error {
	if e.tts == nil || !e.tts.Enabled {
		return fmt.Errorf("tts is not configured")
	}
	if e.tts.TTS == nil {
		return fmt.Errorf("tts provider is not configured")
	}
	if e.tts.MaxTextLen > 0 && utf8.RuneCountInString(text) > e.tts.MaxTextLen {
		return fmt.Errorf("text exceeds max_text_len (%d > %d)", utf8.RuneCountInString(text), e.tts.MaxTextLen)
	}
	as, ok := p.(AudioSender)
	if !ok {
		return fmt.Errorf("platform %s does not support audio sending", p.Name())
	}
	slog.Info("tts: starting synthesis", "voice", e.tts.Voice, "speed", e.tts.Speed, "text_len", len(text))
	opts := TTSSynthesisOpts{
		Voice:        e.tts.Voice,
		LanguageType: e.tts.LanguageType,
		Speed:        e.tts.Speed,
	}
	audioData, format, err := e.tts.TTS.Synthesize(e.ctx, StripMarkdown(text), opts)
	if err != nil {
		return fmt.Errorf("synthesize: %w", err)
	}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Complete the provider configuration under [tts] (credentials, voice) and restart
  2. Verify the provider plugin is compiled in (rebuild without the relevant no_* build tag)
  3. Check startup logs for provider initialization failures; fix the underlying init error
  4. In code, ensure the provider is assigned to e.tts.TTS before calling synthesizeAndSendTTS

Example fix

// before
[tts]
enabled = true
# provider credentials missing
// after
[tts]
enabled = true
provider = "feishu"
app_id = "cli_xxx"
app_secret = "..."
Defensive patterns

Strategy: fallback

Validate before calling

if ttsCfg.Enabled && ttsProvider == nil {
    return errors.New("tts enabled but provider missing; check [tts] provider credentials")
}

Try / catch

if err := e.SynthesizeAndSendTTS(p, replyCtx, text); err != nil {
    if strings.Contains(err.Error(), "provider is not configured") {
        slog.Error("tts provider missing; check provider plugin compiled in and credentials set")
        p.Reply(replyCtx, text) // fallback to text
        return
    }
    return err
}

Prevention

When it happens

Trigger: Config with [tts] enabled = true but a missing/invalid provider configuration so no provider instance was constructed; or programmatic use where the engine was given a TTSConfig without a TTS provider implementation.

Common situations: Partial config migration where the enabled flag was set but provider credentials (e.g. app_id/app_secret for the speech API) were never filled in; a build excluding the TTS provider plugin so registration never happens.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/40388062a6bb22a5. Report an issue: GitHub.