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

Function isToolMessageWithId

agents/e2e/context-pruner.e2e.test.ts:33–41  ·  view source on GitHub ↗

* Type guard to check if a message is a tool message with toolCallId.

(
  msg: Message,
)

Source from the content-addressed store, hash-verified

31 * Type guard to check if a message is a tool message with toolCallId.
32 */
33function isToolMessageWithId(
34 msg: Message,
35): msg is ToolMessage & { toolCallId: string } {
36 return (
37 msg.role === 'tool' &&
38 'toolCallId' in msg &&
39 typeof msg.toolCallId === 'string'
40 )
41}
42/**
43 * Integration tests for the context-pruner agent.
44 * These tests verify that context-pruner correctly prunes message history

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected