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

Function closeNativeReasoningInAgent

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

Source from the content-addressed store, hash-verified

338 * Used when a tool call happens for a subagent.
339 */
340export const closeNativeReasoningInAgent = (
341 blocks: ContentBlock[],
342 agentId: string,
343): ContentBlock[] => {
344 return updateBlocksRecursively(blocks, agentId, (block) => {
345 if (block.type !== 'agent') {
346 return block
347 }
348 const closedBlocks = block.blocks ? closeNativeReasoningBlock(block.blocks) : undefined
349 if (closedBlocks && closedBlocks !== block.blocks) {
350 return { ...block, blocks: closedBlocks }
351 }
352 return block
353 })
354}
355
356/**
357 * Marks the last native reasoning block as complete by setting thinkingOpen: false.

Callers 2

handleToolCallFunction · 0.90

Calls 2

updateBlocksRecursivelyFunction · 0.90

Tested by

no test coverage detected