fix session routing and subagent visibility

This commit is contained in:
wuyang6
2026-06-12 11:06:04 +08:00
parent a6e7d2260b
commit 40d7c92a1d
9 changed files with 447 additions and 45 deletions
+11
View File
@@ -1,5 +1,16 @@
"use client";
export function readSessionIdFromUrl() {
if (typeof window === "undefined") return null;
const match = window.location.pathname.match(/^\/session\/([^/]+)$/);
if (!match?.[1]) return null;
try {
return decodeURIComponent(match[1]).trim() || null;
} catch {
return match[1].trim() || null;
}
}
export function pushSessionUrl(sessionId: string) {
if (typeof window === "undefined") return;
const target = `/session/${encodeURIComponent(sessionId)}`;