Fix @mention resolution for multi-word agent names

MentionTextarea inserted raw agent names (e.g. @Sarah Chen) but the
backend regex captured only the first word (@Sarah), causing mention
resolution to fail silently. Moved canonicalMentionHandle to shared/
so the renderer can produce space-free handles that the backend resolves
correctly.
This commit is contained in:
ZacharyZhang-NY committed 2026-06-30 21:17:43 -04:00
1 parent dfa2df3334
commit 5bb9aea4f9
10 files changed
+17 -12

No files matched your search

@@ -0,0 +1,11 @@
export const RESERVED_MENTION_HANDLES = new Set(["board", "oncall"]);
export function canonicalMentionHandle(value: string): string {
return value.toLowerCase().replace(/[^a-z0-9]/g, "");
}
export function assertUsableMentionName(value: string): void {
if (RESERVED_MENTION_HANDLES.has(canonicalMentionHandle(value))) {
throw new Error("Mention handle is reserved.");
}
}