fix: retain exhausted-chain cooldown classification after extraction
This commit is contained in:
@@ -1716,6 +1716,7 @@ def _fallback_chain_exhausted(agent, reason: "FailoverReason | None") -> bool:
|
||||
"""Chain exhausted (always False). A non-empty chain walked on a non-rate-limit failure arms a
|
||||
short cooldown so next turn's restore_primary_runtime stays gated instead of replaying the whole
|
||||
context across every provider again."""
|
||||
from agent.fallback_cooldown import _RATE_LIMIT_FAILOVER_REASONS
|
||||
if agent._fallback_chain and reason not in _RATE_LIMIT_FAILOVER_REASONS:
|
||||
agent._rate_limited_until = max(
|
||||
getattr(agent, "_rate_limited_until", 0) or 0, time.monotonic() + _FALLBACK_EXHAUSTED_COOLDOWN_S)
|
||||
|
||||
Reference in New Issue
Block a user