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 <noreply@anthropic.com>
This commit is contained in:
chenglun.hu 2026-01-29 10:30:57 +08:00
parent a109b7f1a9
commit dd5021b191
No known key found for this signature in database
GPG Key ID: 11ECC6E33B83267C

View File

@ -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({