Panniantong/Agent-Reach · error · NoProviderConfigured

{provider}: missing {PROVIDERS[provider]['key_field']} (conf

Error message

{provider}: missing {PROVIDERS[provider]['key_field']} (configure with `agent-reach configure {provider}-key ...`)

What it means

Raised as NoProviderConfigured (subclass of TranscribeError) by transcribe_chunk (transcribe.py:371-377) when the Config object has no value for the provider's key field — groq_api_key or openai_api_key. It is a pre-flight check: no network request is attempted without credentials, and the message names the exact config field and the configure command.

Source

Thrown at agent_reach/transcribe.py:374

    field = PROVIDERS[provider]["key_field"]
    val = config.get(field)
    return val or None


def transcribe_chunk(
    chunk: Path,
    provider: str,
    *,
    config: Optional[Config] = None,
    timeout: int = 120,
) -> str:
    """Transcribe one chunk via the named provider. Raises TranscribeError on failure."""
    if provider not in PROVIDERS:
        raise TranscribeError(f"unknown provider: {provider}")
    cfg = config or Config()
    key = _provider_key(provider, cfg)
    if not key:
        raise NoProviderConfigured(
            f"{provider}: missing {PROVIDERS[provider]['key_field']} "
            f"(configure with `agent-reach configure {provider}-key ...`)"
        )

    info = PROVIDERS[provider]
    with chunk.open("rb") as fh:
        try:
            resp = requests.post(
                info["endpoint"],
                headers={"Authorization": f"Bearer {key}"},
                files={"file": (chunk.name, fh, "audio/m4a")},
                data={"model": info["model"], "response_format": "text"},
                timeout=timeout,
            )
        except requests.RequestException as e:
            raise TranscribeError(f"{provider}: network error: {e}") from e

    if not resp.ok:

View on GitHub (pinned to 93ae1d18c3)

Solutions

  1. Run: agent-reach configure groq-key <key> (or openai-key) as the message instructs
  2. Or set the env var / config field directly per agent_reach.config conventions, then verify with agent-reach doctor
  3. In code, pass an explicit config: transcribe_chunk(chunk, 'groq', config=Config()) after loading, or pre-check _provider_key('groq', cfg)

Example fix

# before
transcribe_chunk(chunk, "groq")  # NoProviderConfigured: missing groq_api_key

# after
# shell: agent-reach configure groq-key gsk_...
# or in code:
from agent_reach.config import Config
cfg = Config()
if not cfg.get("groq_api_key"):
    raise RuntimeError("set agent-reach configure groq-key first")
text = transcribe_chunk(chunk, "groq", config=cfg)
Defensive patterns

Strategy: validation

Validate before calling

from agent_reach.transcribe import PROVIDERS, _provider_key
from agent_reach.config import Config

def provider_configured(provider: str, cfg: Config | None = None) -> bool:
    return _provider_key(provider, cfg or Config()) is not None

Try / catch

from agent_reach.transcribe import NoProviderConfigured, transcribe_chunk
try:
    text = transcribe_chunk(chunk, "groq", config=cfg)
except NoProviderConfigured as e:
    prompt_user_to_configure("groq")  # never retry without new credentials
    raise

Prevention

When it happens

Trigger: transcribe_chunk(chunk, 'groq') with no groq_api_key in Config (YAML config or env vars, per agent_reach.config). Fresh installs that never ran `agent-reach configure`, or CI environments where the config file was not carried over.

Common situations: New machine/container without ~/.config setup; key stored under a renamed field after a version change; CI running tests that hit the real transcribe path without fixture config.

Related errors


AI-assisted analysis of Panniantong/Agent-Reach@93ae1d18c3 (2026-08-14). Data as JSON: /api/errors/1903c3e558672470. Report an issue: GitHub.