{# Broken AI connection of an organization the account administers (`Page.ai_alerts`), on every page: the nightly tidy-up must not fail for days without anyone seeing it. #} {% from "ui.html" import when %} {% set why = broken.explanation %} {% set ai_url = "/o/" ~ org.slug ~ "/-/ai" %} {% set cli_name = {"claude_code": "Claude Code", "codex": "Codex"}.get(broken.provider) %} {% if why.code == "cli_login" and cli_name %}{% set cause = _("the {provider} login has expired", provider=cli_name) %}{% else %}{% set cause = _(why.label) %}{% endif %}
{% if broken.runs %}{{ (_("The nightly tidy-up of {org} has not been working since {date}: {cause}.")|e).format(org=org.name, date=when(broken.since, 'date'), cause=cause) }}{% else %}{{ (_("The last connection test of the AI of {org} failed on {date}: {cause}.")|e).format(org=org.name, date=when(broken.since, 'date'), cause=cause) }}{% endif %}
{{ _(why.message, **why.params) }}
{% if request.url.path != ai_url %}{% endif %}