logFallbackAttempt logs information about a fallback attempt
(agentName string, model modelWithFallback, attempt, maxRetries int, err error)
| 90 | |
| 91 | // logFallbackAttempt logs information about a fallback attempt |
| 92 | func logFallbackAttempt(agentName string, model modelWithFallback, attempt, maxRetries int, err error) { |
| 93 | if model.isFallback { |
| 94 | slog.Warn("Fallback model attempt", |
| 95 | "agent", agentName, |
| 96 | "model", model.provider.ID().String(), |
| 97 | "fallback_index", model.index, |
| 98 | "attempt", attempt+1, |
| 99 | "max_retries", maxRetries+1, |
| 100 | "previous_error", err) |
| 101 | } else { |
| 102 | slog.Warn("Primary model failed, trying fallbacks", |
| 103 | "agent", agentName, |
| 104 | "model", model.provider.ID().String(), |
| 105 | "error", err) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | // logRetryBackoff logs when we're backing off before a retry |
| 110 | func logRetryBackoff(agentName string, modelID modelsdev.ID, attempt int, backoffDelay time.Duration) { |