Repository navigation
Release v2.3.3
AI Twin Speaker Tracking & Compact Context Update 🧩
This update makes conversation authorship explicit while keeping the AI Twin context compact. The owner, chat partner, quotes, forwards, and attachment content are now represented separately, reducing ambiguity without repeating participant details for every message. It includes all changes since v2.3.2.
✨ Speaker & Context Improvements
- Explicit Message Authors: AI Twin context distinguishes the account owner, chat partner, other sources, and unknown authors using stable tags and sender IDs rather than display names alone.
- More Reliable Owner Detection: Outgoing messages identify the owner even when
is_selfor sender details are missing. Available cached identity and outgoing history provide additional owner-ID checks. - Separate Quotes & Forward Sources: Reply references and forwarded origins no longer look like new messages from the current sender. Incoming update metadata preserves available quote context when history loading does not include it.
- Attachment Boundaries: Media descriptions and voice transcriptions remain attached to their original message instead of becoming apparent standalone conversation turns.
🔧 Compact Prompt Format
- One Shared Participant Map: Names and sender IDs are listed once; message rows use the compact form
[message_id, speaker_tag, text]with optional details only when needed. - Deduplicated Reply References: Messages reference quotes by ID. Quotes outside the history window are stored once in a shared lookup, including when several messages refer to the same quote.
- Escaped Multiline Text: Newlines and embedded labels stay inside a single message, reducing confusion when text or screenshots contain labels such as
I:or an owner's name. - Shorter System Boilerplate: Condensed the drafting and clock instructions while preserving the configured owner prompt, timezone handling, natural clock style, and system/transcript boundary.
- Message Content Preserved: The compact format removes repeated metadata rather than trimming the messages or recognized attachment text. In a synthetic 100-short-message fixture, context serialization decreased from 15,133 to 3,932 characters compared with verbose JSON records.
🛡️ Stability & Verification
- 86 Automated Tests Passed: Added coverage for outgoing ownership, matching display names, unknown senders, quoted messages, forwards, media boundaries, target-message handling, and compact context size.
- Bounded History Preserved: The incoming target message is included without exceeding the configured history window.
- Playback Ownership Checks: Voice playback receipts use the same owner detection as conversation context.
- Legacy Command Compatibility: The standalone
.aicommand retains its existing text-context format; compact records are enabled for AI Twin replies. - Live Model Checks: Checked partner biography, matching names with an owner quote, and text embedded in a screenshot using the compact context format.
🗂️ Changed Files
-
core/services.py- Added speaker identity helpers, compact context records, shared participant and quote maps, and incoming-target metadata handling.
-
modules/ai_twin.py- Enabled compact conversation context and added the speaker/reference legend to the system instruction.
- Shortened the system boilerplate and made plain-text reply output explicit.
-
tests/test_speaker_context.py- Added speaker, quote, forwarding, media, context-size, and prompt-overhead regression tests.
Full Changelog: v2.3.2...v2.3.3