81ce512705
The multimodal-looker prompt described what to do but never told the model which tools are available. Smaller VL models (e.g. Qwen3-VL-8B) would try to call non-existent tools and enter an infinite loop emitting:
Model tried to call unavailable tool 'invalid'. Available tools: call_omo_agent, read.
Add a single sentence at the top of the prompt that explicitly enumerates the only allowed tools ('read' and 'call_omo_agent') and forbids calling any other tool. This matches the runtime allowlist enforced by createAgentToolAllowlist(["read"]).
Regression test asserts the prompt contains the available-tools enumeration so future prompt rewrites don't regress.
28 lines
858 B
TypeScript
28 lines
858 B
TypeScript
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")
|
|
})
|
|
})
|