KI-Chat: Kontext-Injection repariert (SQL from-Alias) + Datum im Prompt
gatherChatContext() brach mit SQLITE_ERROR ab, weil "e.from_addr AS from"
das SQL-Schlüsselwort from als Alias nutzte. Der Fehler wurde im Route-Handler
geschluckt (context={}), sodass der Assistent keinen Zugriff auf Bewerbungen/
Termine/E-Mails hatte. Alias entfernt.
Zusätzlich erhält der System-Prompt jetzt das heutige Datum, damit der
Assistent "morgen"/"heute" aus den UTC-Termin-Zeitstempeln ableiten kann.
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2328,13 +2328,15 @@ initializeDatabase().then(() => {
|
||||
dbGet('SELECT name FROM settings WHERE id = 1'),
|
||||
dbAll(`SELECT firma, stelle, status, datum, notizen FROM bewerbungen
|
||||
ORDER BY datum DESC, created_at DESC LIMIT 25`),
|
||||
dbAll(`SELECT e.subject, e.from_addr AS from, b.firma AS bewerbung
|
||||
dbAll(`SELECT e.subject, e.from_addr, b.firma AS bewerbung
|
||||
FROM emails e LEFT JOIN bewerbungen b ON b.id = e.bewerbung_id
|
||||
WHERE e.direction = 'received'
|
||||
ORDER BY e.email_date DESC, e.created_at DESC LIMIT 12`),
|
||||
upcomingTermine(8),
|
||||
]);
|
||||
const heute = new Date().toLocaleDateString('de-DE', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
|
||||
return {
|
||||
heute,
|
||||
settings: settings || {},
|
||||
applications: applications.map((a) => ({
|
||||
firma: a.firma, stelle: a.stelle, status: a.status,
|
||||
|
||||
Reference in New Issue
Block a user