mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-03 18:38:35 +02:00
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:
@@ -7,6 +7,7 @@ import { DiscoveredToolingModal } from '@renderer/components/DiscoveredToolingMo
|
||||
import { NewSessionModal } from '@renderer/components/NewSessionModal';
|
||||
import { SettingsPanel } from '@renderer/components/SettingsPanel';
|
||||
import { Sidebar } from '@renderer/components/Sidebar';
|
||||
import { resolveChatToolingSettings } from '@renderer/lib/chatTooling';
|
||||
import {
|
||||
applySessionEventActivity,
|
||||
pruneSessionActivities,
|
||||
@@ -28,7 +29,6 @@ import { syncPatternGraph, type PatternDefinition } from '@shared/domain/pattern
|
||||
import { isScratchpadProject, SCRATCHPAD_PROJECT_ID } from '@shared/domain/project';
|
||||
import { applyScratchpadSessionConfig } from '@shared/domain/session';
|
||||
import type { AppearanceTheme, LspProfileDefinition, McpServerDefinition } from '@shared/domain/tooling';
|
||||
import { resolveProjectToolingSettings } from '@shared/domain/tooling';
|
||||
import type { WorkspaceState } from '@shared/domain/workspace';
|
||||
import { createId, nowIso } from '@shared/utils/ids';
|
||||
|
||||
@@ -180,9 +180,9 @@ export default function App() {
|
||||
[workspace?.projects, workspace?.selectedProjectId],
|
||||
);
|
||||
|
||||
const effectiveTooling = useMemo(
|
||||
() => workspace ? resolveProjectToolingSettings(workspace.settings, selectedProject?.discoveredTooling) : undefined,
|
||||
[workspace?.settings, selectedProject?.discoveredTooling],
|
||||
const chatToolingSettings = useMemo(
|
||||
() => resolveChatToolingSettings(workspace, projectForSession),
|
||||
[projectForSession, workspace],
|
||||
);
|
||||
|
||||
const hasPendingDiscoveries = useMemo(() => {
|
||||
@@ -274,7 +274,7 @@ export default function App() {
|
||||
project={projectForSession}
|
||||
runtimeTools={sidecarCapabilities?.runtimeTools}
|
||||
session={selectedSession}
|
||||
toolingSettings={effectiveTooling ?? workspace.settings.tooling}
|
||||
toolingSettings={chatToolingSettings ?? workspace.settings.tooling}
|
||||
/>
|
||||
);
|
||||
detailPanel = (
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user