fix(email): route summaries through shared LLM adapter (#5841)

* fix(email): route summaries through shared llm adapter

* chore(ci): refresh PR checks

* fix(email): preserve scheduled summary safeguards

---------

Co-authored-by: Matyas Fenyves <16389204+uhhgoat@users.noreply.github.com>
This commit is contained in:
Matyas Gosztonyi
2026-08-08 23:06:41 +02:00
committed by GitHub
co-authored by Matyas Fenyves
parent e4fa4ae5dd
commit 42da399b4d
7 changed files with 670 additions and 60 deletions
+19
View File
@@ -30,6 +30,25 @@ export function _esc(text) {
return div.innerHTML;
}
const _EMAIL_SUMMARY_ERROR_MESSAGES = Object.freeze({
email_summary_missing_body: 'No email body to summarize',
email_summary_not_configured: 'No model configured for email summaries',
email_summary_empty: 'The model returned an empty summary',
email_summary_unavailable: 'Failed to summarize',
});
export function _emailSummaryErrorMessage(result) {
const code = String(result?.error_code || '');
return _EMAIL_SUMMARY_ERROR_MESSAGES[code] || 'Failed to summarize';
}
export function _renderEmailSummaryError(container, result) {
const message = container.ownerDocument.createElement('span');
message.style.color = 'var(--red)';
message.textContent = _emailSummaryErrorMessage(result);
container.replaceChildren(message);
}
function _attrEsc(text) {
return String(text ?? '')
.replace(/"/g, '&quot;')