MCPcopy Create free account
hub / github.com/freecodexyz/free-code / shouldSkipMessage

Function shouldSkipMessage

src/utils/collapseReadSearch.ts:384–401  ·  view source on GitHub ↗

* Check if a message should be skipped (not break the group, just passed through). * This includes thinking blocks, redacted thinking, attachments, etc.

(msg: RenderableMessage)

Source from the content-addressed store, hash-verified

382 * This includes thinking blocks, redacted thinking, attachments, etc.
383 */
384function shouldSkipMessage(msg: RenderableMessage): boolean {
385 if (msg.type === 'assistant') {
386 const content = msg.message.content[0]
387 // Skip thinking blocks and other non-text, non-tool content
388 if (content?.type === 'thinking' || content?.type === 'redacted_thinking') {
389 return true
390 }
391 }
392 // Skip attachment messages
393 if (msg.type === 'attachment') {
394 return true
395 }
396 // Skip system messages
397 if (msg.type === 'system') {
398 return true
399 }
400 return false
401}
402
403/**
404 * Type predicate: Check if a message is a collapsible tool use.

Callers 1

collapseReadSearchGroupsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected