You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tool() has no execution timeout. If a blocking tool's execute() never settles (a fetch to a dead endpoint, a third-party SDK that hangs, a forgotten await), the turn stalls indefinitely:
ToolExecutor.runTool (agents/src/voice/tool_executor.ts) awaits the tool promise with no time bound
The tool's AbortSignal only fires on interruption / explicit cancel() / drain(), never on elapsed time
The only related knob, DRAIN_TOOL_TIMEOUT_MS (via LK_DRAIN_PLAYOUT_TIMEOUT_MS), bounds how long drain waits after abort was already signalled; it does nothing for a tool that hangs mid-turn while the user is silent
Problem
tool()has no execution timeout. If a blocking tool'sexecute()never settles (afetchto a dead endpoint, a third-party SDK that hangs, a forgottenawait), the turn stalls indefinitely:ToolExecutor.runTool(agents/src/voice/tool_executor.ts) awaits the tool promise with no time boundAbortSignalonly fires on interruption / explicitcancel()/drain(), never on elapsed timeDRAIN_TOOL_TIMEOUT_MS(viaLK_DRAIN_PLAYOUT_TIMEOUT_MS), bounds how long drain waits after abort was already signalled; it does nothing for a tool that hangs mid-turn while the user is silentRequested behavior
An
executeTimeout(ms) option ontool():On expiry:
AbortController(one already exists per running task)FunctionCallOutputwith a timeoutToolErrorso the model can tell the user the tool timed out (related: fix(tts): restart ChunkedStream retries under fresh request IDs #1994, "Cancelled function tools vanish without a trace")RunningTaskentry sohasRunningTasksreturns to normalOptionally a default at the
Toolset/AgentSessionlevel, with per-tool override.Why not just
AbortSignal.timeout()in every execute?That's the current workaround and it's:
executeignores the signal (many SDK calls don't accept one), since nothing races the promise from the outsideEnvironment
Happy to contribute a PR if the approach sounds good.