MCPcopy Index your code
hub / github.com/simstudioai/sim / forceFailHungToolCall

Function forceFailHungToolCall

apps/sim/lib/copilot/request/tools/executor.ts:300–334  ·  view source on GitHub ↗
(
  toolCallId: string,
  context: StreamingContext,
  message: string
)

Source from the content-addressed store, hash-verified

298 * can resume Go with an error result instead of waiting forever.
299 */
300export async function forceFailHungToolCall(
301 toolCallId: string,
302 context: StreamingContext,
303 message: string
304): Promise<void> {
305 const toolCall = context.toolCalls.get(toolCallId)
306 if (!toolCall || toolCall.endTime || isTerminalToolCallStatus(toolCall.status)) return
307 setTerminalToolCallState(toolCall, {
308 status: MothershipStreamV1ToolOutcome.error,
309 error: message,
310 })
311 logger.error('Force-failed hung tool call', {
312 toolCallId,
313 toolName: toolCall.name,
314 message,
315 })
316 markToolResultSeen(toolCallId)
317 await completeAsyncToolCall({
318 toolCallId,
319 status: MothershipStreamV1AsyncToolRecordStatus.failed,
320 result: { error: message },
321 error: message,
322 }).catch((err) => {
323 logger.warn('Failed to persist force-failed async tool status', {
324 toolCallId,
325 error: toError(err).message,
326 })
327 })
328 publishTerminalToolConfirmation({
329 toolCallId,
330 status: MothershipStreamV1ToolOutcome.error,
331 message,
332 data: { error: message },
333 })
334}
335
336function cancelledCompletion(message: string): AsyncToolCompletion {
337 return buildCompletionSignal({

Callers 1

runCheckpointLoopFunction · 0.90

Calls 9

isTerminalToolCallStatusFunction · 0.90
setTerminalToolCallStateFunction · 0.90
markToolResultSeenFunction · 0.90
completeAsyncToolCallFunction · 0.90
toErrorFunction · 0.90
errorMethod · 0.80
getMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected