From dd5021b19103804d2609d63e3bcc3beb32fd38a6 Mon Sep 17 00:00:00 2001 From: "chenglun.hu" Date: Thu, 29 Jan 2026 10:30:57 +0800 Subject: [PATCH] fix(tui): handle /model status and /model list as reserved keywords Fixes #3469 The TUI `/model` command was treating all arguments as model names, causing `/model status` to fail with "model not allowed: anthropic/status". Changes: - `/model status` now displays current model info - `/model list` now opens model selector (same as `/model`) This aligns TUI behavior with the message channel's handling of reserved keywords in directive-handling.model.ts. Co-Authored-By: Claude Opus 4.5 --- src/tui/tui-command-handlers.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tui/tui-command-handlers.ts b/src/tui/tui-command-handlers.ts index a14172809..a4273e4e3 100644 --- a/src/tui/tui-command-handlers.ts +++ b/src/tui/tui-command-handlers.ts @@ -276,8 +276,12 @@ export function createCommandHandlers(context: CommandHandlerContext) { await openSessionSelector(); break; case "model": - if (!args) { + if (!args || args === "list") { await openModelSelector(); + } else if (args === "status") { + const provider = state.sessionInfo?.modelProvider || "unknown"; + const model = state.sessionInfo?.model || "unknown"; + chatLog.addSystem(`Current model: ${provider}/${model}`); } else { try { await client.patchSession({