# Upgrade Guide — v0.12.32

<!-- bump: patch -->

## What Changed

### WhatsApp Self-Chat Support (Critical Fix)

Two bugs were preventing personal agents from receiving messages sent from the user's own phone via self-chat:

1. **LID JID handling**: WhatsApp's Linked Identity (LID) JID format (`272404173598970@lid`) doesn't contain a real phone number. `jidToPhone()` now returns `null` for `@lid` JIDs instead of extracting a meaningless number. The WhatsApp adapter maps `@lid` JIDs to the connected phone number stored during backend initialization.

2. **fromMe filter replaced with outbound ID tracking**: The blanket `if (msg.key.fromMe) continue` filter was dropping ALL messages from the user's account, including self-chat commands. Since Baileys connects as a linked device, every message the user sends shows `fromMe=true`. Now, outbound message IDs are tracked in a `Set`, and only messages the *bot* sent are filtered — user-typed self-chat messages pass through.

3. **Accept both notify and append message types**: The `messages.upsert` handler now accepts both `type=notify` (real-time incoming) and `type=append` (outbound echoes, self-chat). This ensures self-chat messages aren't dropped by the type filter.

### PhoneUtils improvements

- `jidToPhone()` returns `null` for `@lid` JIDs (prevents fake phone number extraction)
- `isJid()` now recognizes `@lid` JIDs
- New `isLidJid()` helper for explicit LID detection

## What to Tell Your User

- **Self-chat works**: "You can now send messages to yourself on WhatsApp and your agent will process them as commands. This is the primary use case for personal agents."
- **No configuration needed**: "The fix is automatic — LID JIDs are mapped to your connected phone number."

## Summary of New Capabilities

| Capability | How to Use |
|-----------|-----------|
| Self-chat support | Send yourself a WhatsApp message — agent processes it |
| LID JID mapping | Automatic — maps to connected phone number |
| Outbound echo filtering | Automatic — bot's own messages are tracked and filtered |
