MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / isToolResultMessage

Function isToolResultMessage

agentContext/snip.go:101–119  ·  view source on GitHub ↗
(msg map[string]any)

Source from the content-addressed store, hash-verified

99}
100
101func isToolResultMessage(msg map[string]any) bool {
102 if role, ok := msg["role"].(string); !ok || role != "user" {
103 return false
104 }
105 content, ok := contentBlocks(msg["content"])
106 if !ok {
107 return false
108 }
109 for _, block := range content {
110 blockType, ok := block["type"].(string)
111 if !ok {
112 continue
113 }
114 if blockType == "tool_result" {
115 return true
116 }
117 }
118 return false
119}
120
121func SnipCompactIfNeeded(
122 messages []map[string]any,

Callers 1

SnipCompactIfNeededFunction · 0.85

Calls 1

contentBlocksFunction · 0.70

Tested by

no test coverage detected