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

Method consumeCacheEditsForRequest

agent/loop.go:1166–1185  ·  view source on GitHub ↗
(visibleToolResultIDs map[string]struct{})

Source from the content-addressed store, hash-verified

1164 newBlocks := append([]map[string]any{}, blocks...)
1165 last := copyMap(newBlocks[len(newBlocks)-1])
1166 last["cache_control"] = map[string]any{"type": "ephemeral"}
1167 newBlocks[len(newBlocks)-1] = last
1168 cp := copyMap(msg)
1169 cp["content"] = newBlocks
1170 result = append(result, cp)
1171 }
1172 return result
1173}
1174
1175func absInt(value int) int {
1176 if value < 0 {
1177 return -value
1178 }
1179 return value
1180}
1181
1182func VisibleToolResultIDs(messages []map[string]any) map[string]struct{} {
1183 ids := map[string]struct{}{}
1184 for _, message := range messages {
1185 blocks := contentBlocks(message["content"])
1186 for _, block := range blocks {
1187 if block["type"] != "tool_result" {
1188 continue

Callers 2

queryLoopMethod · 0.95

Calls 1

filterVisibleCacheEditsFunction · 0.85

Tested by

no test coverage detected