( blocks: ContentBlock[], agentId: string, )
| 338 | * Used when a tool call happens for a subagent. |
| 339 | */ |
| 340 | export 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. |
no test coverage detected