From 916534226a914ee7d4130e318a9b4219c2bf9bf0 Mon Sep 17 00:00:00 2001 From: Fh26697 Date: Tue, 19 Aug 2025 15:49:41 +0200 Subject: [PATCH] Chats are not using specified Agent The function createNewConversation is never called with the agentSlug specified so its always opening a new Conversation with the Base Agent --- src/interface/obsidian/src/chat_view.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interface/obsidian/src/chat_view.ts b/src/interface/obsidian/src/chat_view.ts index 6c8d2712..927f7acf 100644 --- a/src/interface/obsidian/src/chat_view.ts +++ b/src/interface/obsidian/src/chat_view.ts @@ -962,7 +962,9 @@ export class KhojChatView extends KhojPaneView { let endpoint = `${this.setting.khojUrl}/api/chat/sessions`; if (agentSlug) { endpoint += `?agent_slug=${encodeURIComponent(agentSlug)}`; - } + } else if (this.currentAgent) { + endpoint += `?agent_slug=${encodeURIComponent(this.currentAgent)}`; + } const response = await fetch(endpoint, { method: "POST",