MCPcopy Create free account
hub / github.com/WJX20/claude-code / isNonCollapsibleToolUse

Function isNonCollapsibleToolUse

src/utils/collapseReadSearch.ts:368–391  ·  view source on GitHub ↗

* Check if a message is a non-collapsible tool use that should break a group. * This includes tool uses like Edit, Write, etc.

(
  msg: RenderableMessage,
  tools: Tools,
)

Source from the content-addressed store, hash-verified

366 * This includes tool uses like Edit, Write, etc.
367 */
368function isNonCollapsibleToolUse(
369 msg: RenderableMessage,
370 tools: Tools,
371): boolean {
372 if (msg.type === 'assistant') {
373 const content = getFirstContentItem(msg.message?.content)
374 if (
375 content && content.type === 'tool_use' &&
376 !isToolSearchOrRead((content as { name: string }).name, (content as { input: unknown }).input, tools)
377 ) {
378 return true
379 }
380 }
381 if (msg.type === 'grouped_tool_use') {
382 const firstContent = getFirstContentItem(msg.messages[0]?.message?.content)
383 if (
384 firstContent && firstContent.type === 'tool_use' &&
385 !isToolSearchOrRead(msg.toolName, (firstContent as { input: unknown }).input, tools)
386 ) {
387 return true
388 }
389 }
390 return false
391}
392
393function isPreToolHookSummary(
394 msg: RenderableMessage,

Callers 1

collapseReadSearchGroupsFunction · 0.85

Calls 2

getFirstContentItemFunction · 0.85
isToolSearchOrReadFunction · 0.85

Tested by

no test coverage detected