(
taskId: string,
agentId: string,
setAppState: SetAppState,
result: {
error: string
summary?: string
tokenCount: number
toolUseCount: number
},
)
| 354 | } |
| 355 | |
| 356 | export 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 | |
| 379 | export function stopWorkflowAgent( |
| 380 | taskId: string, |
no test coverage detected