diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 957bead69..aa3a40589 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -22,6 +22,7 @@ ### Fixed +- Fixed `/model` in the TUI to open the active-session model switcher instead of the role-assignment picker ([#2846](https://github.com/can1357/oh-my-pi/issues/2846)). - Fixed Whisper STT cache detection to require both encoder and decoder `.onnx` files, so partial model downloads now trigger a proper foreground download instead of being treated as fully cached - Fixed same-process `JsRuntime` cleanup so disposing an older inline/direct runtime no longer deletes a newer runtime's JS helper globals; inactive cmux/direct runtimes now re-activate their globals before sequential use while overlapping cross-runtime runs fail explicitly. - Fixed magic-keyword steering notices (`ultrathink-notice`, `orchestrate-notice`, `workflow-notice`) to be prepended before the related user message so they influence that same turn diff --git a/packages/coding-agent/src/slash-commands/builtin-registry.ts b/packages/coding-agent/src/slash-commands/builtin-registry.ts index 2ce79a6cd..49c208f57 100644 --- a/packages/coding-agent/src/slash-commands/builtin-registry.ts +++ b/packages/coding-agent/src/slash-commands/builtin-registry.ts @@ -308,7 +308,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray = [ { name: "model", aliases: ["models"], - description: "Select model (opens selector UI)", + description: "Switch model for this session", acpDescription: "Show current model selection", handle: async (command, runtime) => { if (command.args) { @@ -341,7 +341,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray = [ return commandConsumed(); }, handleTui: (_command, runtime) => { - runtime.ctx.showModelSelector(); + runtime.ctx.showModelSelector({ temporaryOnly: true }); runtime.ctx.editor.setText(""); }, }, diff --git a/packages/coding-agent/test/slash-commands/switch.test.ts b/packages/coding-agent/test/slash-commands/switch.test.ts index 15d0c896e..f52cd5623 100644 --- a/packages/coding-agent/test/slash-commands/switch.test.ts +++ b/packages/coding-agent/test/slash-commands/switch.test.ts @@ -17,6 +17,18 @@ function createRuntime() { }; } +describe("/model slash command", () => { + it("opens the temporary model selector for the active session", async () => { + const harness = createRuntime(); + + const handled = await executeBuiltinSlashCommand("/model", harness.runtime); + + expect(handled).toBe(true); + expect(harness.showModelSelector).toHaveBeenCalledWith({ temporaryOnly: true }); + expect(harness.setText).toHaveBeenCalledWith(""); + }); +}); + describe("/switch slash command", () => { it("opens the temporary model selector (mirrors alt+p)", async () => { const harness = createRuntime();