MCPcopy Create free account
hub / github.com/Epic0522/Codex-Remote-Contact / parseUnifiedMemoryRecallRoute

Function parseUnifiedMemoryRecallRoute

src/server.js:5039–5053  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

5037}
5038
5039function parseUnifiedMemoryRecallRoute(raw) {
5040 try {
5041 const parsed = JSON.parse(String(raw || "").match(/\{[\s\S]*\}/)?.[0] || raw);
5042 const source = ["desktop_recent", "desktop_topic", "mobile_context", "unified", "none"].includes(parsed.source) ? parsed.source : "none";
5043 return {
5044 needsRecall: Boolean(parsed.needsRecall) && source !== "none",
5045 source,
5046 query: String(parsed.query || "").trim().slice(0, 160),
5047 confidence: Math.max(0, Math.min(1, Number(parsed.confidence || 0.5))),
5048 reason: "model"
5049 };
5050 } catch {
5051 return { needsRecall: false, source: "none", query: "", confidence: 0.35, reason: "parse_failed" };
5052 }
5053}
5054
5055async function judgeUnifiedMemoryForIMessage(event) {
5056 const ruleDecision = judgeUnifiedMemoryByRules({

Calls

no outgoing calls

Tested by

no test coverage detected