Merge pull request #4171 from MoerAI/fix/multimodal-looker-tool-usage-guidance
fix(agents): declare multimodal-looker tool allowlist in prompt to prevent death loop on small VL models (fixes #4116)
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
import { describe, test, expect } from "bun:test"
|
||||||
|
import { createMultimodalLookerAgent } from "./multimodal-looker"
|
||||||
|
|
||||||
|
describe("createMultimodalLookerAgent", () => {
|
||||||
|
test("prompt explicitly enumerates the agent's available tools to prevent death loop on small VL models", () => {
|
||||||
|
// given
|
||||||
|
const agent = createMultimodalLookerAgent("openai/gpt-5-nano")
|
||||||
|
|
||||||
|
// when
|
||||||
|
const prompt = typeof agent.prompt === "string" ? agent.prompt : ""
|
||||||
|
|
||||||
|
// then
|
||||||
|
expect(prompt).toMatch(/available tools/i)
|
||||||
|
expect(prompt).toContain("read")
|
||||||
|
})
|
||||||
|
|
||||||
|
test("prompt instructs the agent never to call other tools", () => {
|
||||||
|
// given
|
||||||
|
const agent = createMultimodalLookerAgent("openai/gpt-5-nano")
|
||||||
|
|
||||||
|
// when
|
||||||
|
const prompt = typeof agent.prompt === "string" ? agent.prompt : ""
|
||||||
|
|
||||||
|
// then
|
||||||
|
expect(prompt.toLowerCase()).toContain("never")
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -23,6 +23,8 @@ export function createMultimodalLookerAgent(model: string): AgentConfig {
|
|||||||
...restrictions,
|
...restrictions,
|
||||||
prompt: `You interpret media files that cannot be read as plain text.
|
prompt: `You interpret media files that cannot be read as plain text.
|
||||||
|
|
||||||
|
Your only available tools are 'read' and 'call_omo_agent'. Always use 'read' to load the file first, then analyze the returned content. Never attempt to call any other tool.
|
||||||
|
|
||||||
Your job: examine the attached file and extract ONLY what was requested.
|
Your job: examine the attached file and extract ONLY what was requested.
|
||||||
|
|
||||||
When to use you:
|
When to use you:
|
||||||
|
|||||||
Reference in New Issue
Block a user