diff --git a/src/admin/components/odin/OdinChat.tsx b/src/admin/components/odin/OdinChat.tsx index 5e71e0c..b3e72ab 100644 --- a/src/admin/components/odin/OdinChat.tsx +++ b/src/admin/components/odin/OdinChat.tsx @@ -208,6 +208,24 @@ export default function OdinChat() { const files = attachments.map((a) => a.file); if (!text && files.length === 0) return; + // Guard: Odin is scoped to invoice processing only (for now). A text-only + // message makes NO AI call — it gets a canned reply locally, so open-ended + // chat can't burn API credits. The invoice path (attachments) runs normally. + // (Removing this guard re-enables the general /chat path below for Phase 2.) + if (files.length === 0) { + setTurns((t) => [ + ...t, + { role: "user", content: text }, + { + role: "assistant", + content: + "Momentálně umím zpracovat pouze přijaté faktury. Přiložte prosím fakturu (PDF) a já z ní načtu údaje k uložení.", + }, + ]); + setInput(""); + return; + } + setBusy(true); const prevTurns = turns;