fix(lead): lead-inbox nach Trockenlauf und Einrichtung geschärft

Prüfung der gesendeten Mails vor Antwortvorschlägen, Sammelposten über
gefilterte Suche mit Trefferzahl, neue Muster (Asset Management, Metabase).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
m3ta-chironandClaude Fable 5.2 committed 2026-11-13 18:15:47 +01:00
1 parent f485eb958f
commit 41175b6cf3
4 files changed
+22 -5

No files matched your search

@@ -21,6 +21,10 @@ Cache numbers are not stable: every `search_emails` renumbers. Before a reply, m
Run no other `search_emails` between finding the mail and acting on it. Several mails of one day can be found in one fetch and handled in a row.
**Batch items without browsing.** For a batch item whose mails share a sender or a subject fragment, let the search do the selecting: `search_emails(folder='Inbox', inference_classification='all', search_type='sender'|'subject', query='<address or fragment>', start_date=…, end_date=…)`. The cache then holds only those mails, numbered 1..`count`. Compare `count` with the number in the approved proposal: equal → act on all numbers; different → do nothing and report the count found (a new mail has arrived, or one is gone). This replaces the three-way comparison for batch items only; replies and tickets always use it.
Give `end_date` as an explicit time (`'<today>T23:59'`); `'now'` sometimes fails with a Graph filter error. With `move_single`, go through the numbers in descending order.
## Zammad ticket
1. `kunde_suchen` with the sender's address (for a shared mailbox: the person from the signature). Exactly one hit is needed. No hit for an internal sender → `customer_id: "guess:<address>"`, shown as such in the proposal. Several hits → `Für dich:`.