MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / markAgentComplete

Function markAgentComplete

cli/src/utils/block-operations.ts:472–484  ·  view source on GitHub ↗
(blocks: ContentBlock[], agentId: string)

Source from the content-addressed store, hash-verified

470 })
471
472export 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'.

Callers 2

handleSubagentFinishFunction · 0.90

Calls 2

updateBlocksRecursivelyFunction · 0.90

Tested by

no test coverage detected