feat(persona-chat): continue an SMS thread with a persona

Persona conversations can now be anchored on a message in an SMS thread.
Creating one snapshots the thread up to that message (via SMS-API) into the
row; every turn appends it to the persona prompt with guidance to talk like a
text thread rather than write an insight.

Anchored turns get four tools: get_thread_messages (page the thread),
look_at_message_image (local vision on an MMS photo), get_photos_near_time
(library photos with tags and people) and look_at_photo (local vision on a
library photo). The conversation list filters by contact_id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cameron CordesandClaude Opus 5.5 committed 2026-10-17 18:07:49 -04:00
1 parent fdbcc75391
commit 4ac574d4d2
11 files changed
+1389 -40

No files matched your search

+9
View File
@@ -577,6 +577,15 @@ POST /insights/chat/stream (SSE: text / tool_call / tool_result / trun
GET /insights/chat/history?path=... (rendered transcript with tool invocations)
POST /insights/chat/rewind (truncate transcript at a rendered index)
// Persona chat — "Continue with persona" from an SMS thread (src/ai/sms_anchor.rs)
POST /persona_chat/conversations (body: { persona_id, anchor?: { contact_id, message_id } };
anchor snapshots ~40 SMS-API messages up to message_id into
the row, 502 if SMS-API can't read the thread)
GET /persona_chat/conversations?contact_id=N (only chats anchored on that thread)
// Anchored turns append the thread + chat-register guidance to the persona prompt and add
// the get_thread_messages / look_at_message_image / get_photos_near_time / look_at_photo
// tools (ToolGateOpts.sms_thread_tools). Image tools use the LOCAL vision model.
// User AI Prefs (owner defaults + passive mirror; src/prefs.rs)
GET /prefs (current row; auth)
PUT /prefs (partial update: omitted=unchanged, null=clear, value=set; auth)