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",