* Check if a message should be skipped (not break the group, just passed through). * This includes thinking blocks, redacted thinking, attachments, etc.
(msg: RenderableMessage)
| 405 | * This includes thinking blocks, redacted thinking, attachments, etc. |
| 406 | */ |
| 407 | function shouldSkipMessage(msg: RenderableMessage): boolean { |
| 408 | if (msg.type === 'assistant') { |
| 409 | const content = getFirstContentItem(msg.message?.content) |
| 410 | // Skip thinking blocks and other non-text, non-tool content |
| 411 | if (content && (content.type === 'thinking' || content.type === 'redacted_thinking')) { |
| 412 | return true |
| 413 | } |
| 414 | } |
| 415 | // Skip attachment messages |
| 416 | if (msg.type === 'attachment') { |
| 417 | return true |
| 418 | } |
| 419 | // Skip system messages |
| 420 | if (msg.type === 'system') { |
| 421 | return true |
| 422 | } |
| 423 | return false |
| 424 | } |
| 425 | |
| 426 | /** |
| 427 | * Type predicate: Check if a message is a collapsible tool use. |
no test coverage detected