diff --git a/src-tauri/src/wsl_bridge.rs b/src-tauri/src/wsl_bridge.rs index 452d5b3..1d720c8 100644 --- a/src-tauri/src/wsl_bridge.rs +++ b/src-tauri/src/wsl_bridge.rs @@ -1455,7 +1455,7 @@ fn process_json_line( let subagent_type = input .get("subagent_type") .and_then(|v| v.as_str()) - .unwrap_or("unknown") + .unwrap_or("general-purpose") .to_string(); let model = input .get("model") diff --git a/src/lib/commands/slashCommands.test.ts b/src/lib/commands/slashCommands.test.ts index a333df2..1473e39 100644 --- a/src/lib/commands/slashCommands.test.ts +++ b/src/lib/commands/slashCommands.test.ts @@ -878,6 +878,23 @@ describe("slashCommands", () => { }); }); + describe("/memory execute", () => { + it("opens the memory browser panel without requiring an active conversation", () => { + getMock.mockReturnValue(null); + const memoryCmd = slashCommands.find((cmd) => cmd.name === "memory")!; + memoryCmd.execute(""); + expect(claudeStore.addLine).not.toHaveBeenCalled(); + expect(invokeMock).not.toHaveBeenCalledWith("send_prompt", expect.anything()); + }); + + it("does not send a prompt to Claude when executed", () => { + getMock.mockReturnValue("conv-123"); + const memoryCmd = slashCommands.find((cmd) => cmd.name === "memory")!; + memoryCmd.execute(""); + expect(invokeMock).not.toHaveBeenCalledWith("send_prompt", expect.anything()); + }); + }); + describe("/context execute", () => { it("shows error when no active conversation", async () => { getMock.mockReturnValue(null); diff --git a/src/lib/commands/slashCommands.ts b/src/lib/commands/slashCommands.ts index 79145b3..78f1a10 100644 --- a/src/lib/commands/slashCommands.ts +++ b/src/lib/commands/slashCommands.ts @@ -6,6 +6,7 @@ import { setSkipNextGreeting, updateDiscordRpc } from "$lib/tauri"; import { searchState } from "$lib/stores/search"; import { conversationsStore } from "$lib/stores/conversations"; import { configStore } from "$lib/stores/config"; +import { memoryBrowserStore } from "$lib/stores/memoryBrowser"; export interface SlashCommand { name: string; @@ -287,16 +288,11 @@ export const slashCommands: SlashCommand[] = [ }, { name: "memory", - description: "View and manage auto-memory (Claude Code built-in)", + description: "Open the memory browser panel to view and manage memory files", usage: "/memory", source: "cli", - execute: async () => { - const conversationId = get(claudeStore.activeConversationId); - if (!conversationId) { - claudeStore.addLine("error", "No active conversation"); - return; - } - await invoke("send_prompt", { conversationId, message: "/memory" }); + execute: () => { + memoryBrowserStore.open(); }, }, { diff --git a/src/lib/components/NavMenu.svelte b/src/lib/components/NavMenu.svelte index efc02d6..4985e17 100644 --- a/src/lib/components/NavMenu.svelte +++ b/src/lib/components/NavMenu.svelte @@ -6,6 +6,7 @@ import { editorStore } from "$lib/stores/editor"; import { configStore } from "$lib/stores/config"; import { debugConsoleStore } from "$lib/stores/debugConsole"; + import { memoryBrowserStore } from "$lib/stores/memoryBrowser"; import type { ConnectionStatus } from "$lib/types/messages"; import StatsDisplay from "./StatsDisplay.svelte"; import AboutPanel from "./AboutPanel.svelte"; @@ -71,6 +72,9 @@ let showTaskLoop = $state(false); let showWorkflowPanel = $state(false); let showMemoryPanel = $state(false); + memoryBrowserStore.subscribe((s) => { + showMemoryPanel = s.isOpen; + }); const progress = $derived($achievementProgress); const activeAgentCount = $derived($runningAgentCount); @@ -179,7 +183,7 @@ -