MCPcopy Create free account
hub / github.com/Noumena-Network/code / failWorkflowAgent

Function failWorkflowAgent

src/tasks/LocalWorkflowTask/LocalWorkflowTask.tsx:356–377  ·  view source on GitHub ↗
(
  taskId: string,
  agentId: string,
  setAppState: SetAppState,
  result: {
    error: string
    summary?: string
    tokenCount: number
    toolUseCount: number
  },
)

Source from the content-addressed store, hash-verified

354}
355
356export function failWorkflowAgent(
357 taskId: string,
358 agentId: string,
359 setAppState: SetAppState,
360 result: {
361 error: string
362 summary?: string
363 tokenCount: number
364 toolUseCount: number
365 },
366): void {
367 updateWorkflowAgent(taskId, agentId, setAppState, agent => ({
368 ...agent,
369 status: 'failed',
370 endTime: Date.now(),
371 tokenCount: result.tokenCount,
372 toolUseCount: result.toolUseCount,
373 summary: result.summary ?? agent.summary,
374 error: result.error,
375 }))
376 setWorkflowAgentController(taskId, agentId, undefined, setAppState)
377}
378
379export function stopWorkflowAgent(
380 taskId: string,

Callers 2

runWorkflowAgentTaskFunction · 0.85

Calls 2

updateWorkflowAgentFunction · 0.85

Tested by

no test coverage detected