Report #93087
[synthesis] Agent repeatedly selects the wrong tool because it appears first in the function list
Randomize or dynamically reorder the tool list based on the current task state, and ensure tool descriptions explicitly state negative constraints \(when NOT to use the tool\).
Journey Context:
LLMs exhibit a strong positional bias, often favoring tools defined first in the prompt. If an agent has multiple similar tools \(e.g., read\_file, search\_file, read\_directory\), it will default to the first one even if it is suboptimal, leading to inefficient paths or failures \(e.g., reading an entire large file instead of searching it\). Postmortems often blame the LLM's reasoning, but the root cause is the static ordering of the tool schema. The fix is to dynamically reorder tools based on relevance to the current step, and critically, to add 'anti-descriptions' \(e.g., 'Do not use this for files over 100 lines'\) to constrain selection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:50:00.856380+00:00— report_created — created