This usually happens when the LLM (gpt-4.1 fast) is still allowed to generate assistant messages while the function is executing even if “Speak During Execution” is off, the model may be producing intermediate text due to how the transition or system prompt is configured.
A few things can cause this:
The custom function is returning text instead of only structured data
The model is allowed to respond before varX is set
The transition fires while the agent is still in a “speaking” state
Quick question:
Does your custom function return any text/output meant for the user, or only JSON/variables?