fix: align chat MCP tooling with session project

Resolve chat tooling from the selected session's project instead of the
separately tracked selectedProjectId so project-scoped discovered MCPs do
not appear for the wrong session. Also synchronize selectedProjectId when
a session is selected and add regression tests for both behaviors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David KayaandCopilot committed 2026-03-25 21:57:30 +01:00
1 parent e5878ba9e8
commit c8bb9d6f59
5 files changed
+112 -5

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import type { ProjectRecord } from '@shared/domain/project';
import { resolveProjectToolingSettings, type WorkspaceToolingSettings } from '@shared/domain/tooling';
import type { WorkspaceState } from '@shared/domain/workspace';
export function resolveChatToolingSettings(
workspace: WorkspaceState | undefined,
projectForSession: ProjectRecord | undefined,
): WorkspaceToolingSettings | undefined {
if (!workspace) {
return undefined;
}
return resolveProjectToolingSettings(workspace.settings, projectForSession?.discoveredTooling);
}