Skip to content

Comments

fix: resolve Groq STT key from model_list when providers.groq is absent#602

Merged
xiaket merged 1 commit intosipeed:mainfrom
kernoeb:fix/stt-key-from-model-list
Feb 22, 2026
Merged

fix: resolve Groq STT key from model_list when providers.groq is absent#602
xiaket merged 1 commit intosipeed:mainfrom
kernoeb:fix/stt-key-from-model-list

Conversation

@kernoeb
Copy link
Contributor

@kernoeb kernoeb commented Feb 21, 2026

📝 Description

After migrating from the legacy providers config to the new model_list format, voice transcription silently breaks on Telegram, Discord, and Slack. Voice messages fall back to a plain [voice] placeholder because the Groq API key is read exclusively from cfg.Providers.Groq.APIKey, which is empty post-migration.

This fix adds fallback logic to scan model_list for any entry with a groq/-prefixed model and uses its api_key if the legacy field is absent. The legacy providers.groq.api_key still takes precedence, so backward compatibility is fully preserved.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

Closes #601

📚 Technical Context (Skip for Docs)

🧪 Test Environment

  • Hardware: PC
  • OS: Alpine Linux 3.23 (Docker)
  • Model/Provider: Groq (whisper-large-v3)
  • Channels: Telegram, Discord, Slack

📸 Evidence (Optional)

Click to view Logs/Screenshots

Gateway startup log after fix:

INFO [voice] Groq voice transcription enabled

Voice messages are now correctly transcribed instead of falling back to [voice].

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

When users migrate from the legacy `providers` config to the new
`model_list` format, voice transcription silently breaks on Telegram,
Discord and Slack channels.

The gateway was reading the Groq API key exclusively from
`cfg.Providers.Groq.APIKey`, which is empty once the key is defined
only inside a `model_list` entry. The transcriber was never initialized,
so voice messages fell back to a plain `[voice]` placeholder.

This fix also scans `model_list` for any entry whose `model` field
starts with `groq/` and uses its `api_key` as a fallback, preserving
full backward compatibility with the legacy `providers.groq` field.
@lukemilby
Copy link
Contributor

Not following PR template. Please update to follow template.

@kernoeb
Copy link
Contributor Author

kernoeb commented Feb 21, 2026

my bad, didn't see a mention of the PR template in the readme, fixing this!

@kernoeb
Copy link
Contributor Author

kernoeb commented Feb 21, 2026

fixed, sorry!

Copy link
Collaborator

@alexhoshina alexhoshina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great pr. PTAL @yinwm

Copy link
Collaborator

@Huaaudio Huaaudio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, simple yet effective fix.

Copy link
Collaborator

@xiaket xiaket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xiaket xiaket merged commit b9a6624 into sipeed:main Feb 22, 2026
2 checks passed
zenixls2 pushed a commit to zenixls2/picoclaw that referenced this pull request Feb 22, 2026
…nt (sipeed#602)

When users migrate from the legacy `providers` config to the new
`model_list` format, voice transcription silently breaks on Telegram,
Discord and Slack channels.

The gateway was reading the Groq API key exclusively from
`cfg.Providers.Groq.APIKey`, which is empty once the key is defined
only inside a `model_list` entry. The transcriber was never initialized,
so voice messages fell back to a plain `[voice]` placeholder.

This fix also scans `model_list` for any entry whose `model` field
starts with `groq/` and uses its `api_key` as a fallback, preserving
full backward compatibility with the legacy `providers.groq` field.
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.

Voice transcription silently broken after migrating to model_list

5 participants