Expand description
Misconfiguration-first failure classification.
For every runtime failure, callers must check settings/config before
retrying. This module is the shared detector: given an ErrorCategory
plus the raw error text, it returns actionable ConfigGuidance when the
failure is caused by user misconfiguration (bad credentials, unknown
model/provider, invalid base_url, malformed vtcode.toml, bad MCP or
sampling params).
Transient failures (network, timeout, rate-limit, 5xx) return None so
existing retry policy applies unchanged. LLM argument mistakes (bad patch,
bad tool args) also return None — they lack config markers.
Structs§
- Config
Guidance - Actionable guidance for fixing a misconfiguration.
Enums§
- Misconfiguration
Kind - Kind of user misconfiguration detected.
Functions§
- detect_
misconfiguration - Return guidance when
messageindicates user misconfiguration. - detect_
misconfiguration_ in_ anyhow - Detect configuration failures from an error that may still retain its
typed provider cause. Provider metadata often contains the actionable model
or credential code even when the
Displaymessage is only a generic HTTP failure. - detect_
misconfiguration_ in_ llm_ error - Detect configuration failures using both the primary LLM error message and
provider metadata such as
model_not_foundorinvalid_api_key. - is_
misconfiguration - Convenience predicate for fail-fast checks.