https://retellai.com/?utm_source=discord&utm_medium=seo logo
Flex Mode not using mocks as function call results
# ❓・bug-report
h
When the agent is in flex mode and calls a function during a test, an actual function call happens while a mock is set up and it should be happening. The mock is non-empty and it is during the tests that this happens and breaks the tests. Can someone please look into this?
s
Hi @Hamid Rezaee , Thank you for reaching out. We’ve noted that Flex Mode can sometimes handle tool orchestration differently than standard modes, which may lead to it bypassing local mocks during testing. To resolve this, please check the following: -Endpoint Routing: Ensure your test environment is explicitly pointing the tool_url to your mock server rather than the production endpoint. -Dynamic Injection: Since Flex Mode manages tools dynamically, verify that your mock is initialized before the agent session starts, as Flex Mode may not pick up mocks injected mid-stream. -Manual Injection: As a workaround, try manually pushing the tool_call_result into the conversation via the API to bypass the actual function execution entirely. Let me know if this works