import { AlertCircle } from 'lucide-react'; import type { Message } from '@/api/types'; interface Props { message: Message; } // v1.11.6: doom-loop sentinel. Renders the system row inserted by // services/inference.ts insertDoomLoopSentinel when the model called the // same tool with the same arguments threshold times in a row. Visual // treatment mirrors CapHitSentinel (amber card + alert icon) so users learn // "amber alert = the loop hit a guard rail and stopped" regardless of // which guard fired. Intentionally NO Continue button — retrying with the // same tools would just re-loop; the user needs to restate the prompt or // switch agents instead. export function DoomLoopSentinel({ message }: Props) { const meta = message.metadata; const isDoomLoop = meta !== null && typeof meta === 'object' && meta.kind === 'doom_loop'; const toolName = isDoomLoop ? meta.tool_name : null; const threshold = isDoomLoop ? meta.threshold : null; return (