set_tool_resend_dedupe
set_tool_resend_dedupe
Turn the dedupe of transport retries on or off. It’s on by default.
SignalWire sends a tool request again, with the same tool_call_id, after a
timeout, a failed connection, or a 5xx response, so a slow tool could run twice.
The dedupe answers such a retry with the first attempt’s result, and a retry that
arrives while the first attempt is still running waits for it.
- A retry is a request with the same
call_id,tool_call_id, and function name. A call the model makes again has a newtool_call_idand runs. - A request without a
tool_call_idalways runs. - A handler that raises is answered with a result saying the tool failed before it
finished, and that result is kept: a retry gets it, and the handler doesn’t run
again. An exception raised in middleware, including a
ToolRefusal, isn’t kept, so a retry runs the call again. - The underlying
signalwire.core.tool_middleware.ResendDedupestores results forttlseconds (default600.0) and keeps up tomax_entriesresults (default1024). - The record is kept in the agent’s process. With several processes or replicas, a retry that reaches another one runs the tool again, so make tools that change things safe to run twice.
The dedupe runs first, before any middleware.
Parameters
enabled
False runs every request, retries included.
Returns
AgentBase — Self for method chaining.