refactor: prune legacy group prefixes

This commit is contained in:
Peter Steinberger
2026-01-17 08:46:19 +00:00
parent ab49fe0e92
commit 13b931c006
44 changed files with 160 additions and 179 deletions

View File

@@ -60,7 +60,7 @@ export function classifySessionKey(key: string, entry?: SessionEntry): GatewaySe
if (entry?.chatType === "group" || entry?.chatType === "channel") {
return "group";
}
if (key.startsWith("group:") || key.includes(":group:") || key.includes(":channel:")) {
if (key.includes(":group:") || key.includes(":channel:")) {
return "group";
}
return "direct";
@@ -71,10 +71,6 @@ export function parseGroupKey(
): { channel?: string; kind?: "group" | "channel"; id?: string } | null {
const agentParsed = parseAgentSessionKey(key);
const rawKey = agentParsed?.rest ?? key;
if (rawKey.startsWith("group:")) {
const raw = rawKey.slice("group:".length);
return raw ? { id: raw } : null;
}
const parts = rawKey.split(":").filter(Boolean);
if (parts.length >= 3) {
const [channel, kind, ...rest] = parts;