Fix same-directory workspace ownership

This commit is contained in:
Mohamed Boudra
2026-06-15 22:22:31 +07:00
parent a4d4d42873
commit ba9f7740a8
21 changed files with 599 additions and 139 deletions
@@ -296,14 +296,10 @@ export function createTerminalManager(
}
// When the query carries a workspaceId, two workspaces sharing a cwd must
// not see each other's terminals. Exclude sessions owned by a different
// workspace; keep sessions without an owner (COMPAT: created by clients
// that predate terminal workspace ownership).
// not see each other's terminals. A missing owner is not workspace
// membership; unscoped callers can still list those legacy terminals.
if (options?.workspaceId !== undefined) {
return sessions.filter(
(session) =>
session.workspaceId === undefined || session.workspaceId === options.workspaceId,
);
return sessions.filter((session) => session.workspaceId === options.workspaceId);
}
return sessions;
},