Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: discourage redundant visual tool calls (#15025)

YuTengjing2eb860b59d1b
diff --git a/packages/builtin-tool-lobe-agent/src/manifest.test.ts b/packages/builtin-tool-lobe-agent/src/manifest.test.ts
index bc0dbd6e63a..42249e5affd 100644
--- a/packages/builtin-tool-lobe-agent/src/manifest.test.ts
+++ b/packages/builtin-tool-lobe-agent/src/manifest.test.ts
@@ -25,6 +25,16 @@ describe('LobeAgentManifest', () => {
expect(apiDescription).toContain('answer the user directly with the result');
});
+ it('should instruct agents to prefer native multimodal access before visual analysis', () => {
+ expect(LobeAgentManifest.systemRole).toContain('`analyzeVisualMedia` is only a fallback');
+ expect(LobeAgentManifest.systemRole).toContain(
+ 'media is already visible in the current multimodal context',
+ );
+ expect(LobeAgentManifest.systemRole).toContain(
+ 'active model lacks the needed image/video capability',
+ );
+ });
+
it('should keep visual analysis parameters compatible with strict tool schema validators', () => {
const parameters = LobeAgentManifest.api[0].parameters;
diff --git a/packages/builtin-tool-lobe-agent/src/systemRole.ts b/packages/builtin-tool-lobe-agent/src/systemRole.ts
index 2c1a712aabe..a39b99ac2f1 100644
--- a/packages/builtin-tool-lobe-agent/src/systemRole.ts
+++ b/packages/builtin-tool-lobe-agent/src/systemRole.ts
@@ -205,6 +205,15 @@ When working with plan/todo tools:
</plan_and_todos>
`;
+const visualAnalysisSection = `
+<visual_analysis>
+\`analyzeVisualMedia\` is only a fallback when the active model cannot inspect the requested image/video natively.
+If the media is already visible in the current multimodal context, answer directly without this tool.
+Use it only for refs/URLs you cannot inspect directly, or when the active model lacks the needed image/video capability.
+</visual_analysis>
+`;
+
export const systemPrompt = `Use Lobe Agent capabilities only when the active model needs built-in assistance. Prefer the active model's native capabilities whenever they are sufficient. Follow each tool's description and schema, and use tool results to answer the user directly.
+${visualAnalysisSection}
${planTodoSection}
${subAgentSection}`;