(blocks: ContentBlock[], agentId: string)
| 470 | }) |
| 471 | |
| 472 | export const markAgentComplete = (blocks: ContentBlock[], agentId: string) => |
| 473 | updateBlocksRecursively(blocks, agentId, (block) => { |
| 474 | if (block.type !== 'agent') { |
| 475 | return block |
| 476 | } |
| 477 | // Close any open native reasoning blocks when the agent completes |
| 478 | const closedBlocks = block.blocks ? closeNativeReasoningBlock(block.blocks) : undefined |
| 479 | return { |
| 480 | ...block, |
| 481 | status: 'complete' as const, |
| 482 | ...(closedBlocks && { blocks: closedBlocks }), |
| 483 | } |
| 484 | }) |
| 485 | |
| 486 | /** |
| 487 | * Recursively marks all agent blocks with status 'running' as 'cancelled'. |
no test coverage detected