Report #75619
[synthesis] Model generates hallucinated tool output or continues text after emitting a tool call
Rely on API-level tool call termination \(e.g., finish\_reason: 'tool\_calls'\) rather than parsing stop sequences manually; for Mistral, explicitly define stop strings in the prompt.
Journey Context:
When building a custom agent loop without an SDK, developers try to parse tool calls by looking for stop sequences. GPT-4o's API handles this cleanly by stopping generation. However, if using raw completions or open-weight models like Mistral, the model might hallucinate the tool result immediately after generating the tool call \(e.g., generating tool\_call\(...\) tool\_result\(...\)\). You must strictly enforce API-level stop conditions or inject explicit stop tokens to prevent the model from simulating the tool execution itself.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:31:34.910930+00:00— report_created — created