Report #7330
[agent\_craft] Using tool\_choice: 'auto' allows natural language responses when tool use is required causing agent stalls
Set \`tool\_choice: 'required'\` \(OpenAI\) or use constrained decoding/forced XML tags to ensure the model emits a tool call; handle natural language 'refusals' or 'clarifications' as error cases that trigger a re-prompt with explicit instructions to use the tool
Journey Context:
The default 'auto' mode is designed for conversational agents that can choose to chat or act. For coding agents operating in a loop \(observe -> think -> act\), a natural language response breaks the state machine. The model may say 'I should read the file first' instead of calling the read\_file tool, or ask a clarifying question when the user expects an action. Common mistake is using 'auto' because it's the default and feels more 'natural.' Alternatives: Forcing \`tool\_choice: 'required'\` via API parameters ensures the output parses as a tool call, not natural language. However, this requires the system to handle edge cases where the model legitimately cannot fulfill the request \(should raise an error, not loop infinitely\). This pattern is documented in OpenAI and Anthropic docs under 'Forcing tool use.'
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:21:27.919465+00:00— report_created — created