feat: add user alias mapping for jealousy detection context

Adds user_aliases config section mapping Discord IDs to known nicknames.
Aliases are anonymized and injected into LLM analysis context so it can
recognize when someone name-drops another member (even absent ones).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 10:22:57 -05:00
parent a73d2505d9
commit ad1234ec99
3 changed files with 51 additions and 5 deletions

View File

@@ -489,6 +489,7 @@ class LLMClient:
channel_context: str = "",
user_notes_map: dict[str, str] | None = None,
new_message_start: int | None = None,
user_aliases: str = "",
) -> dict | None:
"""Analyze a conversation block in one call, returning per-user findings."""
if not messages:
@@ -497,6 +498,8 @@ class LLMClient:
convo_block = self._format_conversation_block(messages, new_message_start=new_message_start)
user_content = f"=== CONVERSATION BLOCK ===\n{convo_block}\n\n"
if user_aliases:
user_content += f"=== KNOWN MEMBER ALIASES (names other members use to refer to each other) ===\n{user_aliases}\n\n"
if user_notes_map:
notes_lines = [f" {u}: {n}" for u, n in user_notes_map.items() if n]
if notes_lines: