From 7215c1bdfeeee64991152c21a53d440586526893 Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Sun, 18 Oct 2026 20:17:03 -0400 Subject: [PATCH] fix(persona-chat): don't offer describe_photo in persona chats describe_photo describes the file chat's photo. Persona chats have no photo, so a vision-capable model was offered a tool that could only answer "No image available". Persona chats now build their catalog with the vision gate off; the thread tools still cover looking at images there. Co-Authored-By: Claude Opus 5.5 --- src/ai/persona_chat.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ai/persona_chat.rs b/src/ai/persona_chat.rs index f52c849..e8910ea 100644 --- a/src/ai/persona_chat.rs +++ b/src/ai/persona_chat.rs @@ -935,10 +935,14 @@ impl PersonaChatSession { // Build a no-photo tool catalog. `current_gate_opts_for_persona` // already probes each tool's backing table for presence and // honours the persona's `allow_agent_corrections` toggle. - let mut gate_opts = self.generator.current_gate_opts_for_persona( - backend.images_inline, - Some((user_id, &persona.persona_id)), - ); + // `has_vision` only gates `describe_photo`, which describes the file + // chat's photo. A persona chat has no photo, so the tool could only + // ever answer "No image available" and waste a round. Vision in a + // persona chat goes through the thread tools (look_at_message_image, + // look_at_photo), which use the local vision model directly. + let mut gate_opts = self + .generator + .current_gate_opts_for_persona(false, Some((user_id, &persona.persona_id))); gate_opts.sms_thread_tools = row.anchor.is_some(); let tools = InsightGenerator::build_tool_definitions(gate_opts); // Practice mode narrows the catalog to the thread itself — no