671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
|
# File 'lib/aidp/harness/error_handler.rb', line 671
def create_recovery_plan(error_info, _context = {})
error_type = error_info[:error_type]
case error_type
when :rate_limited
{
action: :switch_provider,
reason: "Rate limit reached, switching provider",
priority: :high
}
when :auth_expired
{
action: :switch_provider,
reason: "Authentication expired – switching provider to continue",
priority: :critical
}
when :quota_exceeded
{
action: :switch_provider,
reason: "Quota exceeded, switching provider",
priority: :high
}
when :transient
{
action: :switch_model,
reason: "Transient error, trying alternate model",
priority: :medium
}
when :permanent
{
action: :escalate,
reason: "Permanent error, requires manual intervention",
priority: :critical
}
when :timeout
{
action: :switch_model,
reason: "Timeout error, trying faster model",
priority: :medium
}
when :network_error
{
action: :switch_provider,
reason: "Network error, switching provider",
priority: :medium
}
when :server_error
{
action: :switch_provider,
reason: "Server error, switching provider",
priority: :medium
}
when :authentication, :permission_denied
{
action: :switch_provider,
reason: "Authentication/permission issue – switching provider to continue",
priority: :critical
}
when :rate_limit
{
action: :switch_provider,
reason: "Rate limit reached, switching provider",
priority: :high
}
else
{
action: :switch_provider,
reason: "Unknown error, attempting provider switch",
priority: :low
}
end
end
|