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

Function appendInterruptionNotice

cli/src/utils/message-block-helpers.ts:234–252  ·  view source on GitHub ↗
(
  blocks: ContentBlock[],
)

Source from the content-addressed store, hash-verified

232 * text block or adding a new one.
233 */
234export const appendInterruptionNotice = (
235 blocks: ContentBlock[],
236): ContentBlock[] => {
237 const lastBlock = blocks[blocks.length - 1]
238
239 if (lastBlock && lastBlock.type === 'text') {
240 const interruptedBlock: ContentBlock = {
241 ...lastBlock,
242 content: `${lastBlock.content}\n\n[response interrupted]`,
243 }
244 return [...blocks.slice(0, -1), interruptedBlock]
245 }
246
247 const interruptionNotice: ContentBlock = {
248 type: 'text',
249 content: '[response interrupted]',
250 }
251 return [...blocks, interruptionNotice]
252}
253
254/**
255 * Recursively finds an agent block by ID and returns its agent type.

Calls

no outgoing calls

Tested by

no test coverage detected