Report #84962
[agent\_craft] Tool choice 'auto' causes agents to hallucinate tool descriptions instead of calling tools
Set \`tool\_choice: 'required'\` \(or force a specific function\) in the API call to constrain the model to output valid tool call JSON rather than free text descriptions of actions
Journey Context:
When using OpenAI's function calling with \`tool\_choice: 'auto'\`, the model decides whether to emit text or a tool call. In complex agent loops with multiple turns, this causes 'stalling': the model outputs 'I will now search for the file' as text instead of calling the search tool. This breaks the agent loop which expects parsable tool calls. For deterministic agent behavior where the orchestrator requires a structured action or explicit no-op, forcing \`tool\_choice: 'required'\` \(newer API feature\) or \`tool\_choice: \{type: 'function', function: \{name: '...'\}\}\` eliminates ambiguity and prevents text hallucinations masquerading as actions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:11:49.625468+00:00— report_created — created