Root agent inconsistently generates introductory text before tool calls #4785
Replies: 1 comment
|
This is a classic output_format underspecification issue. The system prompt doesn't explicitly tell the model not to generate acknowledgment text, so it's making a judgment call each time, and that judgment varies based on context. The fix: add a dedicated output format constraint that says exactly "do not generate introductory text before tool calls, invoke the tool directly." When it's buried in a general system prompt, the model weights it less. When it's in a typed output_format block, it reads it as a hard constraint. Typed semantic blocks help a lot here. I've been building flompt (https://flompt.dev) around this idea: 12 typed blocks (role, objective, constraints, output_format, etc.) that compile to Claude-optimized XML. Keeping output format separate from role/objective makes the constraint much clearer to the model. Open-source: github.com/Nyrok/flompt |
Uh oh!
There was an error while loading. Please reload this page.
Environment
Description
I'm experiencing inconsistent behavior from the root agent when routing user queries to sub-agents (configured as tools).
Sometimes the root agent generates an introductory/acknowledgment message before invoking the tool:
Other times, it directly invokes the tool and returns the response without any introductory text.
This happens with the same types of queries — there's no clear pattern for when it does or doesn't generate the intro message.
Question
LlmAgent, tool routing, or agent instructions) that explicitly controls this?Thanks in advance for any guidance.
All reactions