mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-28 13:47:12 +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:
@@ -852,6 +852,18 @@ export class EryxAppService extends EventEmitter<AppServiceEvents> {
|
||||
|
||||
async selectSession(sessionId?: string): Promise<WorkspaceState> {
|
||||
const workspace = await this.loadWorkspace();
|
||||
if (sessionId) {
|
||||
const session = this.requireSession(workspace, sessionId);
|
||||
const project = this.requireProject(workspace, session.projectId);
|
||||
const didSyncProjectTooling = await this.syncProjectDiscoveredTooling(workspace, project);
|
||||
if (didSyncProjectTooling) {
|
||||
this.pruneUnavailableSessionToolingSelections(workspace);
|
||||
await this.pruneUnavailableApprovalTools(workspace);
|
||||
}
|
||||
|
||||
workspace.selectedProjectId = session.projectId;
|
||||
}
|
||||
|
||||
workspace.selectedSessionId = sessionId;
|
||||
return this.persistAndBroadcast(workspace);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user