#22054: fix(auto-reply): Hide message_id and sender metadata in direct chats
channel: msteams
channel: whatsapp-web
gateway
size: S
Direct chats do not require moderation tracking or complex group threaded history, but this untrusted metadata visibly leaks into the standard DM UI. This change strictly hides this metadata in `isDirect` conversation info context, resolving UI clutter. Tests have been updated to reflect the new behavior.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Hides `message_id`, `conversation_label`, and `sender` fields in direct chat contexts to prevent untrusted metadata from cluttering the DM UI. Tests updated to verify these fields remain visible in group chats.
**Issues found:**
- `message_id_full` field is not hidden in direct chats, allowing metadata to leak when it differs from `message_id`
<h3>Confidence Score: 2/5</h3>
- This PR has a logic bug that allows metadata to leak in direct chats
- Score reflects incomplete implementation - `message_id_full` field is not properly hidden in direct chats, violating the stated goal of preventing metadata leakage in DM UI
- Pay close attention to `src/auto-reply/reply/inbound-meta.ts:81-82` where the `message_id_full` logic needs the `isDirect` check
<sub>Last reviewed commit: f708dfc</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#15998: fix: hide metadata block when only conversation_label is present
by netmanyys · 2026-02-14
76.7%
#23312: fix(gateway): strip inbound metadata in chat history sanitization
by SidQin-cyber · 2026-02-22
73.9%
#20231: fix: strip untrusted metadata blocks from chat history
by MisterGuy420 · 2026-02-18
73.6%
#3300: changed chat session selection logic in iMessage
by KimEJ · 2026-01-28
73.5%
#22832: fix: strip [[reply_to_current]] directive from chat history
by willkriski · 2026-02-21
73.2%
#7261: fix(telegram): preserve DM topic thread id for outbound media
by ViffyGwaanl · 2026-02-02
73.0%
#23271: fix(chat): strip untrusted metadata blocks from Control UI messages
by lbo728 · 2026-02-22
72.8%
#9662: fix(feishu): include sender ID in direct messages for auth
by cszhouwei · 2026-02-05
72.6%
#20301: Security: scrub untrusted metadata from user-facing replies
by ashishc2503 · 2026-02-18
72.4%
#2799: fix(imessage): prevent self-chat and outbound echo loops (#2585)
by Tfh-Yqf · 2026-01-27
72.4%