aKode fase 5: 429 con Retry-After/X-RateLimit-Reset e messaggi in italiano, filtro modelli nel primo avvio, correzioni della rinomina

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 11:41:54 +01:00
parent 86e7c72e5f
commit 8b73331037
130 changed files with 1204 additions and 410 deletions

View File

@@ -123,6 +123,10 @@ pub enum CodexErrorDetails {
/// A retryable upstream rate limit received inside the response stream.
#[error("rate limit exceeded: {0}")]
RateLimitExceeded(String),
/// The provider's daily (or otherwise long-window) request allowance is used up; retrying
/// within the turn cannot succeed.
#[error("Limite giornaliero del provider esaurito. {0}")]
ProviderDailyLimitExhausted(String),
// The iOS input-limit classifier matches this message's ASCII prefix.
#[error(
"Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying."
@@ -442,6 +446,7 @@ impl CodexErr {
| CodexErrorDetails::Fatal(_)
| CodexErrorDetails::UsageNotIncluded
| CodexErrorDetails::QuotaExceeded
| CodexErrorDetails::ProviderDailyLimitExhausted(_)
| CodexErrorDetails::InvalidImageRequest()
| CodexErrorDetails::InvalidRequest(_)
| CodexErrorDetails::InvalidAudioInput { .. }
@@ -520,6 +525,7 @@ impl CodexErr {
CodexErrorDetails::RateLimitExceeded(_) => CodexErrorInfo::RateLimitExceeded,
CodexErrorDetails::UsageLimitReached(_)
| CodexErrorDetails::QuotaExceeded
| CodexErrorDetails::ProviderDailyLimitExhausted(_)
| CodexErrorDetails::UsageNotIncluded => CodexErrorInfo::UsageLimitExceeded,
CodexErrorDetails::ServerOverloaded => CodexErrorInfo::ServerOverloaded,
CodexErrorDetails::PolicyCapacityUnavailable => {