From 928f036033be0a6b263132181b0662951852cc37 Mon Sep 17 00:00:00 2001 From: Till JS Date: Fri, 17 Apr 2026 14:58:32 +0200 Subject: [PATCH] fix(llm): add deep-link to AI settings in tier error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error messages now include a clickable Markdown link "KI-Einstellungen öffnen" that navigates to /?app=settings#ai-options, which opens the settings panel in the workbench, switches to the AI tab, and scrolls to the LLM options section. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/shared-llm/src/errors.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/shared-llm/src/errors.ts b/packages/shared-llm/src/errors.ts index 91c52c6a8..0c4e07bf7 100644 --- a/packages/shared-llm/src/errors.ts +++ b/packages/shared-llm/src/errors.ts @@ -38,16 +38,18 @@ export class NoTierAvailableError extends LlmError { this.name = 'NoTierAvailableError'; } - /** User-friendly German explanation of what went wrong. */ + /** User-friendly German explanation of what went wrong (Markdown). */ getUserMessage(): string { + const settingsLink = '[KI-Einstellungen öffnen](/?app=settings#ai-options)'; + if (this.skipped.length === 0 && this.attempted.length === 0) { - return 'Kein KI-Modell konfiguriert. Aktiviere ein Modell unter Einstellungen → KI.'; + return `Kein KI-Modell konfiguriert.\n\n${settingsLink}`; } const reasons = this.skipped.map((s) => { switch (s.reason) { case 'no-consent': - return `**${tierLabel(s.tier)}**: Cloud-Einwilligung fehlt. Aktiviere sie unter Einstellungen → KI.`; + return `**${tierLabel(s.tier)}**: Cloud-Einwilligung fehlt.`; case 'no-backend': return `**${tierLabel(s.tier)}**: Backend nicht registriert.`; case 'not-available': @@ -60,7 +62,7 @@ export class NoTierAvailableError extends LlmError { return 'Kein KI-Modell konfiguriert.'; } }); - return reasons.join('\n'); + return `${reasons.join('\n')}\n\n${settingsLink}`; } }