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 <noreply@anthropic.com>
This commit is contained in:
Cameron CordesandClaude Opus 5.5 committed 2026-10-18 20:17:03 -04:00
1 parent 3f1bf42f1c
commit 7215c1bdfe
1 file changed
+8 -4
+8 -4
View File
@@ -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