MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / lookup

Method lookup

server/src/server/tool_memory.cpp:60–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60std::string ToolMemory::lookup(const std::vector<std::string> & call_ids) {
61 std::string result_text;
62 bool first = true;
63
64 for (const auto & id : call_ids) {
65 if (id.empty()) return "";
66 auto it = by_id_.find(id);
67 if (it == by_id_.end()) return "";
68
69 if (first) {
70 result_text = it->second;
71 first = false;
72 } else if (result_text != it->second) {
73 return ""; // different blocks — can't replay
74 }
75 touch(id);
76 }
77
78 return result_text;
79}
80
81void ToolMemory::touch(const std::string & call_id) {
82 auto it = lru_map_.find(call_id);

Calls 1

emptyMethod · 0.45