gpp_maybe
{t("modelLockout") || "Model Lockout"}
{t("modelLockoutPageDescription")}
{hasChanges ? (
) : (
)}
{/* Master toggle */}
{
setDraft((prev) => ({ ...prev, enabled: checked }));
playNotify();
}}
label={t("modelLockoutEnabled")}
description={t("modelLockoutEnabledDescription")}
/>
{/* Error codes — tag input */}
{/* Chips row */}
{draft.errorCodes.length > 0 && (
{draft.errorCodes.map((code) => (
{code}
))}
)}
{/* Input row */}
{
const raw = e.target.value.replace(/[^0-9]/g, "");
if (raw.length <= 3) setErrorCodesInput(raw);
}}
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
commitErrorCodes();
}
}}
placeholder="Add error code..."
className="w-32 rounded-lg border border-border bg-bg px-3 py-2 text-sm outline-none focus:border-primary transition-colors placeholder:text-text-muted/50"
/>
{/* Suggested common codes — chips as clickable suggestions */}
{draft.errorCodes.length === 0 && errorCodesInput === "" && (
Suggestions:
{[403, 404, 429, 502, 503, 504].map((code) => (
))}
)}
{/* Cooldowns - grid */}
setDraft((prev) => ({ ...prev, baseCooldownMs }))
}
/>
{t("modelLockoutBaseCooldownDescription")}
setDraft((prev) => ({ ...prev, maxCooldownMs }))
}
/>
{t("modelLockoutMaxCooldownDescription")}
{/* Exponential backoff */}
{
setDraft((prev) => ({
...prev,
useExponentialBackoff: checked,
}));
playNotify();
}}
label={t("modelLockoutExponentialBackoff")}
description={t("modelLockoutExponentialBackoffDescription")}
/>
{/* Max backoff steps */}
setDraft((prev) => ({ ...prev, maxBackoffSteps }))
}
/>
{t("modelLockoutMaxBackoffStepsDescription")}