fix: de-anonymize User1/User2 references in notes and reasoning text
The LLM returns note_update, reasoning, and worst_message with anonymized names. These are now replaced with real display names before storage, so user profiles no longer contain meaningless User1/User2 references. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -292,6 +292,13 @@ class SentimentCog(commands.Cog):
|
|||||||
anon_name = finding.get("username", "")
|
anon_name = finding.get("username", "")
|
||||||
if anon_name in reverse_map:
|
if anon_name in reverse_map:
|
||||||
finding["username"] = reverse_map[anon_name]
|
finding["username"] = reverse_map[anon_name]
|
||||||
|
# De-anonymize text fields that may reference other users
|
||||||
|
for field in ("note_update", "reasoning", "worst_message"):
|
||||||
|
text = finding.get(field)
|
||||||
|
if text:
|
||||||
|
for anon, real in reverse_map.items():
|
||||||
|
text = text.replace(anon, real)
|
||||||
|
finding[field] = text
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _build_conversation(
|
def _build_conversation(
|
||||||
|
|||||||
Reference in New Issue
Block a user