refactor(session): tighten cross-session access

This commit is contained in:
Xubin Ren
2026-08-04 12:14:51 +08:00
parent f15ea84dd1
commit 62d34b5eb7
15 changed files with 792 additions and 299 deletions
+8 -2
View File
@@ -604,8 +604,14 @@ export function ThreadShell({
const chatId = session?.chatId ?? null;
const historyKey = session?.key ?? null;
const mentionSessions = useMemo(
() => sessions.filter((candidate) => candidate.key !== historyKey),
[historyKey, sessions],
() => sessions.filter((candidate) => (
candidate.key !== historyKey
&& (
workspaceScope?.access_mode !== "restricted"
|| candidate.workspaceScope?.project_path === workspaceScope.project_path
)
)),
[historyKey, sessions, workspaceScope],
);
const {
messages: historical,