Models errors

Common error signatures

Failures in the models feature fall into three categories: authentication strategy errors, provider routing failures, and circuit breaker trips.

Where errors originate

Authentication CLI commands are the most common entry points for user-facing failures. Routing and executor errors typically originate deeper in the stack and are reported back to CLI callers.

How to diagnose

  1. Check the exception type first. AllProvidersFailedError means every fallback in the active FallbackPolicy was tried and failed — look at CircuitBreaker.get_status() to see which providers are open. A ValueError or KeyError from AdaptiveModelRouter.get_best_model() usually means the workflow/stage pair has no telemetry data yet.

  2. Inspect the circuit breaker state. Call CircuitBreaker.get_status() to see failure_count, is_open, and opened_at for each provider/tier pair. A provider whose circuit is open will not be attempted until recovery_timeout_seconds has elapsed. Use CircuitBreaker.reset() to force recovery during debugging.

  3. Validate the auth strategy file. If AuthStrategy.load() fails, confirm the file at AUTH_STRATEGY_FILE exists and contains valid JSON with all required fields (see AuthStrategy.from_dict()). Run attune auth-status to surface the parsed values, or attune auth-reset followed by attune auth-setup to rebuild the file from scratch.

  4. Check routing constraints against telemetry. If get_best_model() returns no candidate, the max_cost, max_latency_ms, or min_success_rate thresholds may be too strict for the available ModelPerformance data. Call AdaptiveModelRouter.get_routing_stats() for the relevant workflow and stage to see actual success rates and latencies before tightening constraints.

  5. Examine LLMResponse fields on apparent success. A response object can be returned without raising an exception even when the call failed — LLMResponse.success is False whenever content is empty. Always check this property before treating the response as valid output.

Source files

Tags: models, auth, llm