Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(memory): read slash-separated words as prose, not paths

Sebastian B6dc3b2388c8f
diff --git a/server/memory-fact-checks.test.ts b/server/memory-fact-checks.test.ts
index 689598a1df..ca3240fba6 100644
--- a/server/memory-fact-checks.test.ts
+++ b/server/memory-fact-checks.test.ts
@@ -42,5 +42,7 @@ describe("dream fact checks", () => {
expect(checkDreamFacts(text, [1], [text], [{ threadId: "p", lines: [{ by: "person", text }] }])).toBe(text);
const dated = "Anna wrote /notes/today.md today";
expect(checkDreamFacts(dated, [1], [dated], [{ threadId: "p", lines: [{ by: "person", text: dated, at: Date.parse("2026-03-01T12:00:00Z") }] }])).toBe("Anna wrote /notes/today.md 2026-03-01");
+ const slashed = "Anna works remotely today/tomorrow";
+ expect(checkDreamFacts(slashed, [1], [slashed], [{ threadId: "p", lines: [{ by: "person", text: slashed, at: Date.parse("2026-03-01T12:00:00Z") }] }])).toBe("Anna works remotely 2026-03-01/2026-03-02");
});
});
diff --git a/server/memory-fact-checks.ts b/server/memory-fact-checks.ts
index 58955fd023..add78f54ba 100644
--- a/server/memory-fact-checks.ts
+++ b/server/memory-fact-checks.ts
@@ -6,7 +6,7 @@ import { redactSecretsInText } from "./redact.ts";
const RELATIVE = /(?<!\p{L})(today|yesterday|tomorrow|dziś|dzisiaj|wczoraj|jutro)(?!\p{L})/giu;
const MONTH = /(?<!\p{L})(?:january|february|march|april|may|june|july|august|september|october|november|december|stycz\p{L}*|lutego|luty|marca|marzec|kwiet\p{L}*|maja|maj|czerw\p{L}*|lip\p{L}*|sierp\p{L}*|wrze\p{L}*|paździer\p{L}*|listopad\p{L}*|grud\p{L}*)(?!\p{L})/giu;
const RELATION = /(?<!\p{L})(?:mother|mom|mum|father|dad|wife|husband|partner|son|daughter|sister|brother|matk\p{L}*|mam\p{L}*|ojciec|ojca|żon\p{L}*|mąż|męża|córk\p{L}*|syn\p{L}*|siostr\p{L}*|brat\p{L}*)(?!\p{L})/giu;
-const LOCATION = /https?:\/\/[^\s<>[\]()]+|(?:~\/|\/[\p{L}_.]|[A-Za-z]:\\)[^\s<>[\](),;]*/gu;
+const LOCATION = /https?:\/\/[^\s<>[\]()]+|(?:~\/|(?<![\p{L}\p{N}])\/[\p{L}_.]|[A-Za-z]:\\)[^\s<>[\](),;]*/gu;
const NUMBER = /\p{N}+(?:[.,:/-]\p{N}+)*%?/gu;
const NAME = /(?<!\p{L})\p{Lu}[\p{L}\p{M}]+(?!\p{L})/gu;
const SENTENCE_WORDS = new Set("The A An I User Owner Person Client Prefers Keep New Old Uses Use Run Note Remember Works My Her His Their They He She It Shorter Too Also".toLowerCase().split(" "));